This commit is contained in:
Marc-Antoine Dumont 2015-08-12 18:13:47 -04:00
commit 47f1d52e44

View File

@ -7,18 +7,11 @@ public class Stats : MonoBehaviour {
private int amountOfWood; private int amountOfWood;
private int amountOfCorpse; private int amountOfCorpse;
private int amountOfMeat; private int amountOfMeat;
private int amountOfZombies; private int amountOfZombies;
private int amountOfHumans; private int amountOfHumans;
private int amountOfZombiesAvail; private int amountOfZombiesAvail;
public Stats(int nbRock, int nbWood, int nbCorpse, int nbMeat, int nbHumans, int nbZombies)
{
AmountOfCorpse = nbCorpse;
AmountOfMeat = nbMeat;
AmountOfRock = nbRock;
AmountOfWood = nbWood;
}
public int AmountOfMeat public int AmountOfMeat
{ {
get { return amountOfMeat; } get { return amountOfMeat; }
@ -61,6 +54,21 @@ public class Stats : MonoBehaviour {
set { amountOfZombiesAvail = value; } set { amountOfZombiesAvail = value; }
} }
public Stats(int nbRock, int nbWood, int nbCorpse, int nbMeat, int nbHumans, int nbZombies)
{
resetStats(nbRock, nbWood, nbCorpse, nbMeat, nbHumans, nbZombies);
}
public void resetStats(int nbRock, int nbWood, int nbCorpse, int nbMeat, int nbHumans, int nbZombies)
{
AmountOfCorpse = nbCorpse;
AmountOfMeat = nbMeat;
AmountOfRock = nbRock;
AmountOfWood = nbWood;
AmountOfHumans = nbHumans;
AmountOfZombies = nbZombies;
}
public void addCorpse() public void addCorpse()
{ {
amountOfCorpse++; amountOfCorpse++;
@ -81,12 +89,59 @@ public class Stats : MonoBehaviour {
amountOfRock++; amountOfRock++;
} }
public void addZombie()
{
amountOfZombies++;
}
public void addHuman()
{
amountOfHumans++;
}
public void addZombieAvail()
{
amountOfZombiesAvail++;
}
public void removeCorpse()
{
amountOfCorpse--;
}
public void removeWood()
{
amountOfWood--;
}
public void removeMeat()
{
amountOfMeat--;
}
public void removeRock()
{
amountOfRock--;
}
public void removeZombie()
{
amountOfZombies--;
}
public void removeHuman()
{
amountOfHumans--;
}
public void removeZombieAvail()
{
amountOfZombiesAvail--;
}
// Use this for initialization // Use this for initialization
void Start () { void Start () {
AmountOfCorpse = 1; resetStats(0, 0, 0, 0, 4, 1);
AmountOfMeat = 2;
AmountOfRock = 3;
AmountOfWood = 4;
} }
// Update is called once per frame // Update is called once per frame