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 void
createGroup
(Set<? extends GameElement> prototypes, String name) Create a new group of Elements.static GameElement
Generate a new GameElement at position.static GameElement
generate
(GameElement element) Generate a new GameElement.static GameElement
generateDefaultCoin
(int x, int y) Generate aDefaultCoin
at position.static GameElement
generateInanimate
(int x, int y) GenerateInanimate
at position.static GameElement
getPrototype
(String id) Get Prototype by identifier.static void
Initialize GameElementFactory.static void
Set 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
InanimateBox
of 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 aDefaultCoin
at position.- Parameters:
x
- the x posy
- the y pos- Returns:
- the generated
GameElement
-
generateInanimate
GenerateInanimate
at position.- Parameters:
x
- the x posy
- the y pos- Returns:
- the generated
GameElement
-