Package 

Class Satchel

  • All Implemented Interfaces:
    kotlin.collections.Iterable

    
    public class Satchel<T extends GameComponentView>
    extends GameComponentContainer<T>
                        

    A Satchel may be used to visualize a pool containing GameComponentViews.

    A typical use case for a Satchel may be to visualize a pile of hidden items, where the user should not know what item might be drawn next.

    Visualization:

    The current Visual is used to visualize the area from where the user can start a drag and drop gesture.

    How to Use:

    Upon adding a GameComponentView to a Satchel a snapshot of the initial state of the GameComponentView gets created and stored. Then the GameComponentView is made draggable, invisible and its size gets fit to the Satchel size.

    The initial state consist of the following properties:

    -isDraggable

    -isVisible

    -width

    -height

    Any changes made to those properties while a GameComponentView is contained in the Satchel get ignored, but they override the initial state.

    As soon as a component gets removed (e.g. by initiating a drag and drop gesture) the initial state gets restored. The GameComponentView at the highest index in the components list registers the next drag and drop gesture above this Satchel.