Package com.mygdx.auber.entities
Class NPCCreator
- java.lang.Object
-
- com.mygdx.auber.entities.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 voidcreateCrew(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 voidcreateInfiltrator(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 voidcreateInfiltrator(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 voiddispose()Called when this object is deleted.static java.lang.Stringencode()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 booleanhasCrew()Returns if this NPCCreator has crew.static booleanhasInfiltrators()Returns if this NPCCreator has infiltrators.static voidLoadCrewFromEncoding(java.lang.String coordinate, java.lang.String lastCrewIndex, MapGraph mapGraph)static voidloadInfiltratorsFromEncoding(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 voidremoveCrewmember(int id)Removes crewmember for given id.static voidremoveInfiltrator(Player p, int id)Removes infiltrator for given id.
-
-
-
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 infiltratorstart- Start node for infiltratorgraph- 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 infiltratorx- 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.
-
-