Package rekit.logic.gameelements
Class GameElementFactory
java.lang.Object
rekit.logic.gameelements.GameElementFactory
This class will be used to load and group all GameElements.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateGroup(Set<? extends GameElement> prototypes, String name) Create a new group of Elements.static GameElementGenerate a new GameElement at position.static GameElementgenerate(GameElement element) Generate a new GameElement.static GameElementgenerateDefaultCoin(int x, int y) Generate aDefaultCoinat position.static GameElementgenerateInanimate(int x, int y) GenerateInanimateat position.static GameElementgetPrototype(String id) Get Prototype by identifier.static voidInitialize GameElementFactory.static voidSet the current scene.
-
Method Details
-
setScene
Set the current scene.- Parameters:
scene- the current scene.
-
getPrototype
Get Prototype by identifier.- Parameters:
id- the identifier- Returns:
- the GameElement or
InanimateBoxof none found.
-
generate
Generate a new GameElement at position.- Parameters:
id- the idx- the x posy- the y posmodifiers- the optional modifiers- Returns:
- the generated
GameElement
-
generate
Generate a new GameElement.- Parameters:
element- the element- Returns:
- the generated
GameElement
-
initialize
public static void initialize()Initialize GameElementFactory. -
createGroup
Create a new group of Elements.- Parameters:
prototypes- the prototypesname- the name of the group
-
generateDefaultCoin
Generate aDefaultCoinat position.- Parameters:
x- the x posy- the y pos- Returns:
- the generated
GameElement
-
generateInanimate
GenerateInanimateat position.- Parameters:
x- the x posy- the y pos- Returns:
- the generated
GameElement
-