Class GameManager


  • public final class GameManager
    extends java.lang.Object
    Responsible for creating most entity's associated with the game. Also the cached chest and cannonballs
    • Constructor Summary

      Constructors 
      Constructor Description
      GameManager()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addNPCMyShip()  
      static void CreateCollege​(int factionId)
      Creates the college with it's building for the desired college
      static void CreateMonster()
      Creates monster
      static NPCShip CreateNPCShip​(int factionId)
      Creates an NPC ship with the given faction
      static void CreatePlayer()
      Creates player that belongs the faction with id 1
      static Weather CreateWeather()
      Creates weather
      static void CreateWorldMap​(int mapId)
      Creates the world map
      static College getCollege​(int factionId)  
      static Faction getFaction​(int factionId)  
      static QueueFIFO<com.badlogic.gdx.math.Vector2> getPath​(com.badlogic.gdx.math.Vector2 loc, com.badlogic.gdx.math.Vector2 dst)
      uses a* not sure if it works but i think it does
      static Player getPlayer()
      Player is always in ships at index 0
      static com.badlogic.gdx.utils.JsonValue getSettings()
      Gets the setting object from the GameSetting.json
      static java.util.ArrayList<Ship> getShips()  
      static void Initialize()
      facilitates creation of the game
      static void shoot​(Ship p, com.badlogic.gdx.math.Vector2 dir)
      Utilises the cached cannonballs to fire one
      static void shoot2​(College c, com.badlogic.gdx.math.Vector2 dir)
      Utilises the cached cannonballs to fire one
      static void SpawnGame​(int mapId)
      Creates the game with player maps, NPCs, colleges
      static void update()
      called every frame checks id the quests are completed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ships

        public static java.util.ArrayList<Ship> ships
      • colleges

        public static java.util.ArrayList<College> colleges
      • weathers

        public static java.util.ArrayList<Weather> weathers
      • monsters

        public static java.util.ArrayList<Monster> monsters
    • Constructor Detail

      • GameManager

        public GameManager()
    • Method Detail

      • Initialize

        public static void Initialize()
        facilitates creation of the game
      • update

        public static void update()
        called every frame checks id the quests are completed
      • getPlayer

        public static Player getPlayer()
        Player is always in ships at index 0
        Returns:
        the ship
      • getShips

        public static java.util.ArrayList<Ship> getShips()
      • SpawnGame

        public static void SpawnGame​(int mapId)
        Creates the game with player maps, NPCs, colleges
        Parameters:
        mapId - the resource id of the tilemap
      • CreatePlayer

        public static void CreatePlayer()
        Creates player that belongs the faction with id 1
      • CreateMonster

        public static void CreateMonster()
        Creates monster
      • CreateWeather

        public static Weather CreateWeather()
        Creates weather
      • CreateNPCShip

        public static NPCShip CreateNPCShip​(int factionId)
        Creates an NPC ship with the given faction
        Parameters:
        factionId - desired faction
        Returns:
        the created ship
      • addNPCMyShip

        public static void addNPCMyShip()
      • CreateWorldMap

        public static void CreateWorldMap​(int mapId)
        Creates the world map
        Parameters:
        mapId - resource id
      • CreateCollege

        public static void CreateCollege​(int factionId)
        Creates the college with it's building for the desired college
        Parameters:
        factionId - desired faction
      • getFaction

        public static Faction getFaction​(int factionId)
      • getSettings

        public static com.badlogic.gdx.utils.JsonValue getSettings()
        Gets the setting object from the GameSetting.json
        Returns:
        the JSON representation fo settings
      • getCollege

        public static College getCollege​(int factionId)
      • shoot

        public static void shoot​(Ship p,
                                 com.badlogic.gdx.math.Vector2 dir)
        Utilises the cached cannonballs to fire one
        Parameters:
        p - parent
        dir - shoot direction
      • shoot2

        public static void shoot2​(College c,
                                  com.badlogic.gdx.math.Vector2 dir)
        Utilises the cached cannonballs to fire one
        Parameters:
        c - College that fires
        dir - shoot direction
      • getPath

        public static QueueFIFO<com.badlogic.gdx.math.Vector2> getPath​(com.badlogic.gdx.math.Vector2 loc,
                                                                       com.badlogic.gdx.math.Vector2 dst)
        uses a* not sure if it works but i think it does
        Parameters:
        loc - src
        dst - dst
        Returns:
        queue of delta postions