Package net.sf.gridarta.model.gameobject
Interface GameObjectFactory<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Known Implementing Classes:
AbstractGameObjectFactory,AbstractIsoGameObjectFactory,DefaultGameObjectFactory,DefaultGameObjectFactory,DefaultGameObjectFactory
public interface GameObjectFactory<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>Abstract factory for creatingGameObjectinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GcloneGameObject(G gameObject)Creates a copy of a game object.GcloneMultiGameObject(G gameObject)Creates a copy of a game object, including tail parts.GcreateGameObject(R archetype)Creates a new GameObject from anArchetype.GcreateGameObjectPart(R archetype, G head)Creates a new GameObject from anArchetype.voidcreateInventory(@NotNull GameObject<G,A,R> gameObject, @NotNull java.lang.Iterable<G> archetype)Copies inventory objects from an archetype into a game object.RnewArchetype(@NotNull java.lang.String archetypeName)Creates a newArchetypeinstance.
-
-
-
Method Detail
-
newArchetype
@NotNull R newArchetype(@NotNull @NotNull java.lang.String archetypeName)
Creates a newArchetypeinstance.- Parameters:
archetypeName- the name of the archetype- Returns:
- the new archetype
-
createGameObject
@NotNull G createGameObject(@NotNull R archetype)
Creates a new GameObject from anArchetype.- Parameters:
archetype- the archetype- Returns:
- the new game object
-
createGameObjectPart
@NotNull G createGameObjectPart(@NotNull R archetype, @Nullable G head)
Creates a new GameObject from anArchetype.- Parameters:
archetype- the archetypehead- the head part to add to- Returns:
- the new game object
-
cloneGameObject
@NotNull G cloneGameObject(@NotNull G gameObject)
Creates a copy of a game object.- Parameters:
gameObject- the game object to copy- Returns:
- the new game object
-
cloneMultiGameObject
@NotNull G cloneMultiGameObject(@NotNull G gameObject)
Creates a copy of a game object, including tail parts. This object must be the head part.- Parameters:
gameObject- the game object to copy- Returns:
- the new game object
-
createInventory
void createInventory(@NotNull @NotNull GameObject<G,A,R> gameObject, @NotNull @NotNull java.lang.Iterable<G> archetype)Copies inventory objects from an archetype into a game object.- Parameters:
gameObject- the game object to add toarchetype- the archetype to copy from
-
-