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

  • All Implemented Interfaces:
    ScriptArchData<G,​A,​R>

    public class DefaultScriptArchData<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    implements ScriptArchData<G,​A,​R>
    Stores and manages information about scripted events. This data is only needed for those arches with one or more events defined.
    XXX:
    This class is designed very badly, as it combines model and presentation.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultScriptArchData​(@NotNull java.lang.String subtypeAttribute, int eventTypeNo)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      G getScriptedEvent​(int eventSubtype, G gameObject)
      Search the owner game object for an event object of the specified event type.
      boolean isEmpty​(G gameObject)
      Returns whether this ScriptArchData is empty (contains no events).
      • Methods inherited from class java.lang.Object

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

      • DefaultScriptArchData

        public DefaultScriptArchData​(@NotNull
                                     @NotNull java.lang.String subtypeAttribute,
                                     int eventTypeNo)
        Creates a new instance.
        Parameters:
        subtypeAttribute - the attribute name for the subtype field
        eventTypeNo - the object type for event objects
    • Method Detail

      • getScriptedEvent

        @Nullable
        public G getScriptedEvent​(int eventSubtype,
                                  @NotNull
                                  G gameObject)
        Description copied from interface: ScriptArchData
        Search the owner game object for an event object of the specified event type.
        Specified by:
        getScriptedEvent in interface ScriptArchData<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
        Parameters:
        eventSubtype - look for a ScriptedEvent of this type
        gameObject - the game object to operate on
        Returns:
        the event game object, or null if no event of this type exists
      • isEmpty

        public boolean isEmpty​(@NotNull
                               G gameObject)
        Description copied from interface: ScriptArchData
        Returns whether this ScriptArchData is empty (contains no events). (Note that empty ScriptArchData objects always are removed ASAP.)
        Specified by:
        isEmpty in interface ScriptArchData<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
        Parameters:
        gameObject - the game object to operate on
        Returns:
        true if this ScriptArchData contains no events, otherwise false