com.TeamHEC.LocomotionCommotion.Goal
Class PlayerGoals

java.lang.Object
  extended by com.TeamHEC.LocomotionCommotion.Goal.PlayerGoals

public class PlayerGoals
extends java.lang.Object

Author:
Robert Precious PlayerGoals are the (up to) 3 goals that the player owns. We have the actual Goals, the Goal Actors and the Labels (like GoalMenu) with the addition of the removeButtons which can remove goals or undo a goal choice from the goal menu.

Field Summary
static boolean chooseTrain
           
static GoalActor newgoal1
           
static GoalActor newgoal2
           
static GoalActor newgoal3
           
static int numberofOwnedGoals
           
static boolean open
           
static SpriteButton planRouteBtn
           
static java.util.HashMap<java.lang.String,GoalActor> playerGoalActors
           
static java.util.HashMap<java.lang.String,Goal> playerGoals
           
static PlayerGoalRemoveBtn removebtn1
           
static PlayerGoalRemoveBtn removebtn2
           
static PlayerGoalRemoveBtn removebtn3
           
static Goal selectedGoal
           
static GoalActor selectedGoalActor
           
static int stagestart
           
 com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style
           
 com.badlogic.gdx.scenes.scene2d.ui.Label ticket1
           
 com.badlogic.gdx.scenes.scene2d.ui.Label ticket2
           
 com.badlogic.gdx.scenes.scene2d.ui.Label ticket3
           
static int ticketActors
           
 
Constructor Summary
PlayerGoals()
           
 
Method Summary
static boolean addGoal(GoalActor newgoal)
          AddGoal takes a new Goal Actor and adds it to player goals by taking its goal attributes and adding it to the bottom of the current player goals.
static void changePlayer(Player player)
          Change Player is used when we end turn to get the goals of the player whose turn it is.
 void create(com.badlogic.gdx.scenes.scene2d.Stage stage)
           
static void goalMenuClose()
          Moves the playerGoals in to place when the goal menu is closed.
static void goalMenuOpen()
          Moves the playerGoals in to place when the goal menu is opened.
static void removeGoal(int goalIndex)
          RemoveGoal takes a goal index, removes that goal and shuffles the others up (if needed)
static java.lang.String ticketMaker(java.lang.String type, int reward, java.lang.String from, int startdate, java.lang.String dest, java.lang.String route)
          Creates the string that make up the ticket information
static java.lang.String ticketMaker(java.lang.String type, int reward, java.lang.String from, int startdate, java.lang.String dest, java.lang.String route, int turnLimit)
          TicketMaker for time limited and combo goals
static void undoGoalSelection(int index)
          undoGoalSelection puts back the goal you just picked from the goal menu.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

playerGoals

public static java.util.HashMap<java.lang.String,Goal> playerGoals

playerGoalActors

public static java.util.HashMap<java.lang.String,GoalActor> playerGoalActors

newgoal1

public static GoalActor newgoal1

newgoal2

public static GoalActor newgoal2

newgoal3

public static GoalActor newgoal3

ticket1

public com.badlogic.gdx.scenes.scene2d.ui.Label ticket1

ticket2

public com.badlogic.gdx.scenes.scene2d.ui.Label ticket2

ticket3

public com.badlogic.gdx.scenes.scene2d.ui.Label ticket3

style

public com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle style

removebtn1

public static PlayerGoalRemoveBtn removebtn1

removebtn2

public static PlayerGoalRemoveBtn removebtn2

removebtn3

public static PlayerGoalRemoveBtn removebtn3

open

public static boolean open

stagestart

public static int stagestart

ticketActors

public static int ticketActors

numberofOwnedGoals

public static int numberofOwnedGoals

planRouteBtn

public static SpriteButton planRouteBtn

selectedGoal

public static Goal selectedGoal

selectedGoalActor

public static GoalActor selectedGoalActor

chooseTrain

public static boolean chooseTrain
Constructor Detail

PlayerGoals

public PlayerGoals()
Method Detail

create

public void create(com.badlogic.gdx.scenes.scene2d.Stage stage)

ticketMaker

public static java.lang.String ticketMaker(java.lang.String type,
                                           int reward,
                                           java.lang.String from,
                                           int startdate,
                                           java.lang.String dest,
                                           java.lang.String route)
Creates the string that make up the ticket information

Parameters:
type -
reward -
from -
startdate -
dest -
route -
Returns:
String ticket

ticketMaker

public static java.lang.String ticketMaker(java.lang.String type,
                                           int reward,
                                           java.lang.String from,
                                           int startdate,
                                           java.lang.String dest,
                                           java.lang.String route,
                                           int turnLimit)
TicketMaker for time limited and combo goals

Parameters:
type -
reward -
from -
startdate -
dest -
route -
turnLimit -
Returns:
String ticket

goalMenuOpen

public static void goalMenuOpen()
Moves the playerGoals in to place when the goal menu is opened. This is used to avoid having to create more objects.


goalMenuClose

public static void goalMenuClose()
Moves the playerGoals in to place when the goal menu is closed. This is used to avoid having to create more objects.


removeGoal

public static void removeGoal(int goalIndex)
RemoveGoal takes a goal index, removes that goal and shuffles the others up (if needed)

Parameters:
goalIndex - - the index of the goal you want to remove from PlayerGoals.

addGoal

public static boolean addGoal(GoalActor newgoal)
AddGoal takes a new Goal Actor and adds it to player goals by taking its goal attributes and adding it to the bottom of the current player goals.

Parameters:
newgoal - the GoalMenu GoalActor which you want to add to the playerGoals
Returns:
Returns true if successful and false if not.

undoGoalSelection

public static void undoGoalSelection(int index)
undoGoalSelection puts back the goal you just picked from the goal menu. You cannot do this once you leave the GoalMenu.

Parameters:
index - -The index of the player goal the player wants to put back.

changePlayer

public static void changePlayer(Player player)
Change Player is used when we end turn to get the goals of the player whose turn it is.

Parameters:
player - -current Player.