Human-Farm-Tycoon/Assets/Controller/RessourceController.cs
Mike 00ac24146f Updated some of our Model Classes.
New Class: Stats (Main class storing our variables for our resources)
Added some buttons and text fields to the scene to show off the functionality of our Stats class.
2015-08-12 16:08:14 -04:00

61 lines
1.3 KiB
C#

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class RessourceController{
Stats stats;
Text viewWood;
Text viewRock;
Text viewCorpse;
Text viewMeat;
public RessourceController(Stats stats, Text viewW, Text viewR, Text viewC, Text viewM)
{
this.stats = stats;
this.viewCorpse = viewC;
this.viewWood = viewW;
this.viewRock = viewR;
this.viewMeat = viewM;
}
public void setRock(int nbRock){
stats.AmountOfRock = nbRock;
}
public int getRock(){
return stats.AmountOfRock;
}
public void setWood(int nbWood)
{
stats.AmountOfWood = nbWood;
}
public int getWood()
{
return stats.AmountOfWood;
}
public void setCorpse(int nbCorpse)
{
stats.AmountOfCorpse = nbCorpse;
}
public int getCorpse()
{
return stats.AmountOfCorpse;
}
public void setMeat(int nbMeat)
{
stats.AmountOfMeat = nbMeat;
}
public int getMeat()
{
return stats.AmountOfMeat;
}
public void UpdateView()
{
viewRock.text = ""+ getRock() +"";
viewMeat.text = "" + getMeat() + "";
viewWood.text = "" + getWood() + "";
viewCorpse.text = "" + getCorpse() + "";
}
}