Blaze Brigade
Static Public Member Functions | List of all members
Controller.GameFunction Class Reference

Contains functions pertaining to the general game. More...

Static Public Member Functions

static bool isEnemyUnitInRange (Graph graph, Unit unit, Unit enemyUnit)
 
static void startTurn (Player player)
 
static bool hasUnitFinishedActions (Unit unit)
 
static bool isTurnOver ()
 
static bool isGameOver (Player player1, Player player2)
 
static LinkedList< NodesetMovableNodes (Graph graph, Unit unit)
 
static LinkedList< NodegetAttackableNodes (Graph graph, Unit unit)
 
static LinkedList< NodegetAttackRangeAfterMoving (Graph graph, Unit unit)
 
static LinkedList< NodepathFinder (Graph graph, Unit unit, Node start, Node end)
 
static void removeUnit (Graph graph, Player player, Unit unit)
 
static void deselectUnit ()
 
static Unit getUnitOnNodeClicked (Node clickedNode, Vector2 positionClicked, Player player)
 
static void updateUnitPosition (Graph graph, Vector2 position, LinkedList< Node > path)
 
static void endTurn ()
 
static void buttonAction (Button button, Graph graph)
 
static bool isMagicalAttack (Unit unit)
 
static Button getMenuButtonClicked (Vector2 mouseCoordinates, Camera camera)
 
static void scrollMap (Camera camera, int mouseX, int mouseY)
 

Detailed Description

Contains functions pertaining to the general game.

This class holds useable functions in the scope of the entire gameplay.

Member Function Documentation

§ buttonAction()

static void Controller.GameFunction.buttonAction ( Button  button,
Graph  graph 
)
static

Updates the Model based upon button clicks.

Parameters
buttonButton that was clicked.
graphGraph of the map.

§ deselectUnit()

static void Controller.GameFunction.deselectUnit ( )
static

Deselects any selected unit.

§ endTurn()

static void Controller.GameFunction.endTurn ( )
static

Ends the current player's turn and starts the enemy player's turn.

§ getAttackableNodes()

static LinkedList<Node> Controller.GameFunction.getAttackableNodes ( Graph  graph,
Unit  unit 
)
static

Returns a list of nodes that the unit can perform an attack on. Assumes the unit has not yet moved.

Parameters
graphGraph representing the current game map.
unitSpecfied unit.

§ getAttackRangeAfterMoving()

static LinkedList<Node> Controller.GameFunction.getAttackRangeAfterMoving ( Graph  graph,
Unit  unit 
)
static

Returns whether or not the specified enemy unit is within attack range of the specified unit. Assumes the unit has already moved.

Parameters
graphGraph representing the current game map.
Specifiedunit.

§ getMenuButtonClicked()

static Button Controller.GameFunction.getMenuButtonClicked ( Vector2  mouseCoordinates,
Camera  camera 
)
static

Returns the menu button that was clicked; if no menu button was clicked, returns null.

Parameters
mouseCoordinatesCoordinates of the mouse click.
cameraThe camera of the game.

§ getUnitOnNodeClicked()

static Unit Controller.GameFunction.getUnitOnNodeClicked ( Node  clickedNode,
Vector2  positionClicked,
Player  player 
)
static

If unit exists where user clicked (that belongs to player), return it; else, return null.

Parameters
clickedNodeNode where user has clicked.
positionClickedposition (by node) of where the user has clicked.
playerPlayer that is currently moving.

§ hasUnitFinishedActions()

static bool Controller.GameFunction.hasUnitFinishedActions ( Unit  unit)
static

Returns whether or not the specified unit can perform actions.

Parameters
unitSpecified unit.

§ isEnemyUnitInRange()

static bool Controller.GameFunction.isEnemyUnitInRange ( Graph  graph,
Unit  unit,
Unit  enemyUnit 
)
static

Returns whether or not the specified enemy unit is within attack range of the specified unit.

Parameters
graphGraph representing the current game map.
unitSpecified playable unit.
enemyUnitSpecified enemy unit.

§ isGameOver()

static bool Controller.GameFunction.isGameOver ( Player  player1,
Player  player2 
)
static

Returns whether or not the game is over, based off win conditions.

§ isMagicalAttack()

static bool Controller.GameFunction.isMagicalAttack ( Unit  unit)
static

Returns whether or not the unit performed a magical attack.

Parameters
unitUnit to check.

§ isTurnOver()

static bool Controller.GameFunction.isTurnOver ( )
static

Returns whether or not the current turn is over.

§ pathFinder()

static LinkedList<Node> Controller.GameFunction.pathFinder ( Graph  graph,
Unit  unit,
Node  start,
Node  end 
)
static

Returns a list of nodes representing the path from start node to end node; if no path is valid, return null.

Parameters
graphGraph representing the current game map.
unitUnit to move.
startStart Node of the path.
endEnd Node of the path

§ removeUnit()

static void Controller.GameFunction.removeUnit ( Graph  graph,
Player  player,
Unit  unit 
)
static

Removes the specified unit from the game.

Parameters
unitunit to remove from the game.

§ scrollMap()

static void Controller.GameFunction.scrollMap ( Camera  camera,
int  mouseX,
int  mouseY 
)
static

Enables scrolling of the map based on mouse position.

Parameters
cameraThe camera of the game.
mouseXx-coordinate of the mouse position.
mouseYy-coordinate of the mouse position.

§ setMovableNodes()

static LinkedList<Node> Controller.GameFunction.setMovableNodes ( Graph  graph,
Unit  unit 
)
static

Returns a list of nodes that the unit can move onto.

Parameters
graphGraph representing the current game map.
Specifiedunit.

§ startTurn()

static void Controller.GameFunction.startTurn ( Player  player)
static

Must be called upon the start of a new turn. Resets all unit buttons and game states.

Parameters
playerPlayer of the new turn.

§ updateUnitPosition()

static void Controller.GameFunction.updateUnitPosition ( Graph  graph,
Vector2  position,
LinkedList< Node path 
)
static

Updates the unit's position to the clicked position.

Parameters
graphGraph representing the current game map.
positionPosition (by node) to move the unit to.
pathPath to move the unit along.

The documentation for this class was generated from the following file: