Class NPCCreator


  • public class NPCCreator
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      NPCCreator()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void createCrew​(com.badlogic.gdx.graphics.g2d.Sprite sprite, Node start, MapGraph graph)
      Creates crewmembers, adds them to the array, sets its index and increments the index counter.
      static void createInfiltrator​(com.badlogic.gdx.graphics.g2d.Sprite sprite, Node start, MapGraph graph)
      Creates infiltrators, adds them to the array, sets its index and increments the index counter.
      static void createInfiltrator​(com.badlogic.gdx.graphics.g2d.Sprite sprite, java.lang.Float x, java.lang.Float y, MapGraph graph)
      Creates infiltrators, adds them to the array, sets its index and increments the index counter.
      static void dispose()
      Called when this object is deleted.
      static java.lang.String encode()
      Encodes all of the NPCs in the game into a recognisable string.
      static com.badlogic.gdx.utils.Array<CrewMembers> getCrew()
      Returns the list of Crew Members.
      static com.badlogic.gdx.utils.Array<Infiltrator> getInfiltrators()
      Returns the list of Infiltrators.
      static boolean hasCrew()
      Returns if this NPCCreator has crew.
      static boolean hasInfiltrators()
      Returns if this NPCCreator has infiltrators.
      static void LoadCrewFromEncoding​(java.lang.String coordinate, java.lang.String lastCrewIndex, MapGraph mapGraph)  
      static void loadInfiltratorsFromEncoding​(java.lang.String coordinate, java.lang.String isDestroying, java.lang.String invisible, java.lang.String timesInvisible, java.lang.String isHardSprites, java.lang.String lastInfiltratorIndex, MapGraph mapGraph)  
      static void removeCrewmember​(int id)
      Removes crewmember for given id.
      static void removeInfiltrator​(Player p, int id)
      Removes infiltrator for given id.
      • Methods inherited from class java.lang.Object

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

      • NPCCreator

        public NPCCreator()
    • Method Detail

      • encode

        public static java.lang.String encode()
        Encodes all of the NPCs in the game into a recognisable string.
        Returns:
        encoded data of all the NPCs in the game.
      • loadInfiltratorsFromEncoding

        public static void loadInfiltratorsFromEncoding​(java.lang.String coordinate,
                                                        java.lang.String isDestroying,
                                                        java.lang.String invisible,
                                                        java.lang.String timesInvisible,
                                                        java.lang.String isHardSprites,
                                                        java.lang.String lastInfiltratorIndex,
                                                        MapGraph mapGraph)
      • LoadCrewFromEncoding

        public static void LoadCrewFromEncoding​(java.lang.String coordinate,
                                                java.lang.String lastCrewIndex,
                                                MapGraph mapGraph)
      • createInfiltrator

        public static void createInfiltrator​(com.badlogic.gdx.graphics.g2d.Sprite sprite,
                                             Node start,
                                             MapGraph graph)
        Creates infiltrators, adds them to the array, sets its index and increments the index counter.
        Parameters:
        sprite - Sprite to give infiltrator
        start - Start node for infiltrator
        graph - MapGraph for the infiltrator to reference
      • createInfiltrator

        public static void createInfiltrator​(com.badlogic.gdx.graphics.g2d.Sprite sprite,
                                             java.lang.Float x,
                                             java.lang.Float y,
                                             MapGraph graph)
        Creates infiltrators, adds them to the array, sets its index and increments the index counter.
        Parameters:
        sprite - Sprite to give infiltrator
        x - Start x coordinate for the infiltrator.
        y - Start y coordinate for the infiltrator.
        graph - MapGraph for the infiltrator to reference
      • createCrew

        public static void createCrew​(com.badlogic.gdx.graphics.g2d.Sprite sprite,
                                      Node start,
                                      MapGraph graph)
        Creates crewmembers, adds them to the array, sets its index and increments the index counter.
        Parameters:
        sprite - The sprite used for this crewmate.
        start - The node this crewmate will start on.
        graph - The MapGraph this crewmate will use to navigate.
      • removeInfiltrator

        public static void removeInfiltrator​(Player p,
                                             int id)
        Removes infiltrator for given id.
        Parameters:
        p - The current Player.
        id - id to remove.
      • removeCrewmember

        public static void removeCrewmember​(int id)
        Removes crewmember for given id.
        Parameters:
        id - id to remove.
      • dispose

        public static void dispose()
        Called when this object is deleted.
      • hasCrew

        public static boolean hasCrew()
        Returns if this NPCCreator has crew.
        Returns:
        true if crew is not empty, false otherwise.
      • hasInfiltrators

        public static boolean hasInfiltrators()
        Returns if this NPCCreator has infiltrators.
        Returns:
        true if infiltrators is not empty, false otherwise.
      • getInfiltrators

        public static com.badlogic.gdx.utils.Array<Infiltrator> getInfiltrators()
        Returns the list of Infiltrators.
        Returns:
        the list of Infiltrators.
      • getCrew

        public static com.badlogic.gdx.utils.Array<CrewMembers> getCrew()
        Returns the list of Crew Members.
        Returns:
        the list of Crew Members.