Blaze-Brigade
Public Member Functions | Properties | List of all members
Model.Unit Interface Reference

Unit Interface for Warrior, Mage, and Archer. More...

Inheritance diagram for Model.Unit:
Model.Archer Model.Mage Model.Warrior

Public Member Functions

int getMovability ()
 
int [] getStats ()
 
void setInitialStats ()
 
bool isButtonActive (ButtonType buttonType)
 
void setButtonCoordinates (Vector2 pixelCoordinates)
 
Texture2D getSpriteImage ()
 
Texture2D getButtonImage (ButtonType buttonType)
 
Texture2D getCharInfo ()
 
Texture2D getCharAttackInfo ()
 
Button [] getButtons ()
 
Button getButtonType (ButtonType buttonType)
 
Rectangle getCurrentFrame ()
 
Weapon [] getEquipableWeapons ()
 
UnitType getClass ()
 
Texture2D getHealthBar ()
 
int getMaxHp ()
 

Properties

bool Alive [get, set]
 
int Hp [get, set]
 
int Str [get, set]
 
int Int [get, set]
 
int Skill [get, set]
 
int Speed [get, set]
 
int Def [get, set]
 
int Res [get, set]
 
int Level [get, set]
 
Weapon equippedWeapon [get, set]
 
int currentFrame [get, set]
 
Tuple< int, int > Position [get, set]
 
Vector2 PixelCoordinates [get, set]
 

Detailed Description

Unit Interface for Warrior, Mage, and Archer.

This is the interface for the 3 playable unit classes, where the only differences in the units will be their statistics and graphical assets

Member Function Documentation

§ getButtonImage()

Texture2D Model.Unit.getButtonImage ( ButtonType  buttonType)

Returns the button texture at index i.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getButtons()

Button [] Model.Unit.getButtons ( )

Returns the dropdown menu buttons of the unit.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getButtonType()

Button Model.Unit.getButtonType ( ButtonType  buttonType)

Method takes in the buttonType enum, then returns the object associated with that enum.

Parameters
buttonTypeThe button to return (Move, Attack, Item, Wait, and attack confirm).

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getCharAttackInfo()

Texture2D Model.Unit.getCharAttackInfo ( )

Returns the char attack info screen texture.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getCharInfo()

Texture2D Model.Unit.getCharInfo ( )

Returns the char info screen texture.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getClass()

UnitType Model.Unit.getClass ( )

Returns unit's class (warrior, mage, archer).

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getCurrentFrame()

Rectangle Model.Unit.getCurrentFrame ( )

Returns the current sprite frame in animation sequence. The rectangle starts at currentFrame * 32, where 32 is the sprite sheet offset between frames, and is 32 high and wide.
Exceptions:
-Assumes that each sprite frame is 32pixels wide.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getEquipableWeapons()

Weapon [] Model.Unit.getEquipableWeapons ( )

TODO - Not yet used
Returns array of equipable weapons.
Exceptions:
-If this array is empty, unit cannot equip any weapons.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getHealthBar()

Texture2D Model.Unit.getHealthBar ( )

Returns the healthBar Texture.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getMaxHp()

int Model.Unit.getMaxHp ( )

Returns the unit's max HP.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getMovability()

int Model.Unit.getMovability ( )

Returns the unit's movability range on grid (number of spaces the unit can move in one turn)
Exceptions:
-Negative movement will be treated as 0 in path finding algorithm

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getSpriteImage()

Texture2D Model.Unit.getSpriteImage ( )

Returns the sprite image of the unit.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ getStats()

int [] Model.Unit.getStats ( )

returns all stats as an array

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ isButtonActive()

bool Model.Unit.isButtonActive ( ButtonType  buttonType)

Indicates whether a button has already been previously selected or not.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ setButtonCoordinates()

void Model.Unit.setButtonCoordinates ( Vector2  pixelCoordinates)

Sets the coordinates of menu buttons. One for loop will position the main Drop Down menu (potentailly containing attack, move, item and wait directly 32 pixels to the right of unit (so the tile to right of unit) , and for each active button, increment it downwards by 32 pixels (height of each button). The second for loop is similiar and is for the inventory menu buttons, except it starts 160 pixels offsetted to right (to the right of the main drop down menu).

Parameters
pixelCoordinatesThe pixel coordinates of the button.

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

§ setInitialStats()

void Model.Unit.setInitialStats ( )

sets initial unit stats upon creation

Implemented in Model.Mage, Model.Archer, and Model.Warrior.

Property Documentation

§ Alive

bool Model.Unit.Alive
getset

Sets and returns whether or not unit is alive

§ currentFrame

int Model.Unit.currentFrame
getset

Sets and gets the current frame of the animation sequence.

§ Def

int Model.Unit.Def
getset

Sets and returns a unit's Defense
Exceptions:
-Negative defense will result in an attacker doing more damage than their attack

§ equippedWeapon

Weapon Model.Unit.equippedWeapon
getset

Returns weapon the unit is currently equipping.

§ Hp

int Model.Unit.Hp
getset

Sets and returns a unit's HP. Should HP fall under 0, Unit's Alive Boolean should change to false

§ Int

int Model.Unit.Int
getset

Sets and returns a unit's Intelliegence
Exceptions:
-Negative strength will be treated as 0 in damage calculation, as damage dealt can not be negative

§ Level

int Model.Unit.Level
getset

Sets and returns a unit's Level. Currently does not have any use

§ PixelCoordinates

Vector2 Model.Unit.PixelCoordinates
getset

Returns the pixel coordinate of the unit, sets the pixel coordinate, and also sets Position (which is the tile location of that coordinate).
Exceptions:
-Dead units will still have a position, but won't impact the rest of the game.

§ Position

Tuple<int, int> Model.Unit.Position
getset

Gets and sets unit's position by tile. The set also updates pixelCoordinate's location by making that vector equivalent to position*32 (since each tile is 32x32).
Exceptions:
-Dead units will still have a position, but won't impact the rest of the game

§ Res

int Model.Unit.Res
getset

Sets and returns a unit's Resistance
Exceptions:
-Negative resistance will result in an attacker doing more damage than their intelligence

§ Skill

int Model.Unit.Skill
getset

Sets and returns a unit's Skill
Exceptions:
-Negative skill will not result in an error, but will most likely result in a 0% hit and crit rate

§ Speed

int Model.Unit.Speed
getset

Sets and returns a unit's Speed
Exceptions:
-Negative skill will not result in an error as speed is only used for checking double attack boolean, which is binary

§ Str

int Model.Unit.Str
getset

Sets and returns a unit's Strength
Exceptions:
-Negative strength will be treated as 0 in damage calculation, as damage dealt can not be negative


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