public class DefaultScriptedEventFactory extends AbstractScriptedEventFactory<GameObject,MapArchObject,Archetype>
AbstractScriptedEventFactory
for creating Crossfire
related instances.Constructor and Description |
---|
DefaultScriptedEventFactory(@NotNull ScriptArchUtils scriptArchUtils,
@NotNull java.lang.String subtypeAttribute,
@NotNull GameObjectFactory<GameObject,MapArchObject,Archetype> gameObjectFactory,
@NotNull ScriptedEventEditor<GameObject,MapArchObject,Archetype> scriptedEventEditor,
@NotNull ArchetypeSet<GameObject,MapArchObject,Archetype> archetypeSet)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
@NotNull GameObject |
newEventGameObject(int eventType)
Return a new event game object for a given event type.
|
@NotNull ScriptedEvent<GameObject,MapArchObject,Archetype> |
newScriptedEvent(GameObject event)
Creates a new
ScriptedEvent instance. |
@NotNull ScriptedEvent<GameObject,MapArchObject,Archetype> |
newScriptedEvent(int eventType,
@NotNull java.lang.String pluginName,
@NotNull java.lang.String scriptPath,
@NotNull java.lang.String options)
Creates a new
ScriptedEvent instance. |
public DefaultScriptedEventFactory(@NotNull @NotNull ScriptArchUtils scriptArchUtils, @NotNull @NotNull java.lang.String subtypeAttribute, @NotNull @NotNull GameObjectFactory<GameObject,MapArchObject,Archetype> gameObjectFactory, @NotNull @NotNull ScriptedEventEditor<GameObject,MapArchObject,Archetype> scriptedEventEditor, @NotNull @NotNull ArchetypeSet<GameObject,MapArchObject,Archetype> archetypeSet)
scriptArchUtils
- the script arch utils instance to usesubtypeAttribute
- the attribute name for the subtype fieldgameObjectFactory
- the game object factory for creating game
objectsscriptedEventEditor
- the scripted event editor to usearchetypeSet
- the archetype set to use@NotNull public @NotNull ScriptedEvent<GameObject,MapArchObject,Archetype> newScriptedEvent(int eventType, @NotNull @NotNull java.lang.String pluginName, @NotNull @NotNull java.lang.String scriptPath, @NotNull @NotNull java.lang.String options) throws UndefinedEventArchetypeException
ScriptedEventFactory
ScriptedEvent
instance.eventType
- type of the eventpluginName
- name of the pluginscriptPath
- path to the file for this eventoptions
- the options for this eventUndefinedEventArchetypeException
- In case there is no Archetype to
create a ScriptedEvent.@NotNull public @NotNull ScriptedEvent<GameObject,MapArchObject,Archetype> newScriptedEvent(GameObject event)
ScriptedEventFactory
ScriptedEvent
instance.event
- the event game object@NotNull public @NotNull GameObject newEventGameObject(int eventType) throws UndefinedEventArchetypeException
ScriptedEventFactory
newEventGameObject
in interface ScriptedEventFactory<GameObject,MapArchObject,Archetype>
newEventGameObject
in class AbstractScriptedEventFactory<GameObject,MapArchObject,Archetype>
eventType
- the event typeUndefinedEventArchetypeException
- if the event game object cannot
be created