Class ModelUpdater<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>


  • public class ModelUpdater<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    Updates a DefaultListModel instance to reflect the contents of a MapSquare instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModelUpdater​(@NotNull javax.swing.DefaultListModel<G> model, @NotNull MapViewSettings mapViewSettings)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int update​(@Nullable GameObjectContainer<G,​A,​R> mapSquare, G gameObject)
      Updates the model to reflect a MapSquare.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModelUpdater

        public ModelUpdater​(@NotNull
                            @NotNull javax.swing.DefaultListModel<G> model,
                            @NotNull
                            @NotNull MapViewSettings mapViewSettings)
        Creates a new instance.
        Parameters:
        model - the model to update
        mapViewSettings - the map view settings to use
    • Method Detail

      • update

        public int update​(@Nullable
                          @Nullable GameObjectContainer<G,​A,​R> mapSquare,
                          @Nullable
                          G gameObject)
        Updates the model to reflect a MapSquare.
        Parameters:
        mapSquare - the map square selection
        gameObject - the selected game object
        Returns:
        the list index to select or -1 to select nothing