Skip to content
Snippets Groups Projects
Commit d489e61d authored by Susan Yuen's avatar Susan Yuen
Browse files

Updated unit class

parent ea30498e
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace Model
{
......@@ -19,6 +21,8 @@ namespace Model
Weapon[] getEquipableWeapons(); // returns array of equipable weapons
int getLevel(); // returns unit's level
UnitType getClass(); // returns unit's class (warrior, mage, archer)
Texture2D getSpriteImage(); // returns the sprite image of the unit
Vector2 getCurrentPosition(); // returns the current position (pixel coordinates) of the sprite
}
enum UnitType { Warrior, Archer, Mage }; //defines the possible classes of a unit
......
......@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace Model
{
......@@ -18,11 +20,14 @@ namespace Model
private int criticalRate;
private int level;
private Weapon[] equipableWeapons;
private Texture2D spriteImage;
private Vector2 position;
public Warrior(Player p)
public Warrior(Texture2D image, Vector2 positionCoordinates)
{
// TODO: setup pre-determined stats for warrior
player = p;
spriteImage = image;
position = positionCoordinates;
}
public bool isAlive()
......@@ -84,5 +89,15 @@ namespace Model
{
return UnitType.Warrior;
}
public Texture2D getSpriteImage()
{
return spriteImage;
}
public Vector2 getCurrentPosition()
{
return position;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment