Class GameElementFactory

java.lang.Object
rekit.logic.gameelements.GameElementFactory

public final class GameElementFactory extends Object
This class will be used to load and group all GameElements.
  • Method Details

    • setScene

      public static void setScene(IScene scene)
      Set the current scene.
      Parameters:
      scene - the current scene.
    • getPrototype

      public static GameElement getPrototype(String id)
      Get Prototype by identifier.
      Parameters:
      id - the identifier
      Returns:
      the GameElement or InanimateBox of none found.
    • generate

      public static GameElement generate(String id, int x, int y, String... modifiers)
      Generate a new GameElement at position.
      Parameters:
      id - the id
      x - the x pos
      y - the y pos
      modifiers - the optional modifiers
      Returns:
      the generated GameElement
    • generate

      public static GameElement generate(GameElement element)
      Generate a new GameElement.
      Parameters:
      element - the element
      Returns:
      the generated GameElement
    • initialize

      public static void initialize()
      Initialize GameElementFactory.
    • createGroup

      public static void createGroup(Set<? extends GameElement> prototypes, String name)
      Create a new group of Elements.
      Parameters:
      prototypes - the prototypes
      name - the name of the group
    • generateDefaultCoin

      public static GameElement generateDefaultCoin(int x, int y)
      Generate a DefaultCoin at position.
      Parameters:
      x - the x pos
      y - the y pos
      Returns:
      the generated GameElement
    • generateInanimate

      public static GameElement generateInanimate(int x, int y)
      Generate Inanimate at position.
      Parameters:
      x - the x pos
      y - the y pos
      Returns:
      the generated GameElement