mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-24 02:11:07 +00:00
Correction of mistake between Controller and View.
This commit is contained in:
parent
c845b4d18b
commit
9cbd459ec4
@ -1,15 +1,60 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RessourceController : MonoBehaviour {
|
||||
public class RessourceController{
|
||||
Bank bank;
|
||||
Text viewWood;
|
||||
Text viewRock;
|
||||
Text viewCorpse;
|
||||
Text viewMeat;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
public RessourceController(Bank b, Text viewW, Text viewR, Text viewC, Text viewM)
|
||||
{
|
||||
this.bank = b;
|
||||
this.viewCorpse = viewC;
|
||||
this.viewWood = viewW;
|
||||
this.viewRock = viewR;
|
||||
this.viewMeat = viewM;
|
||||
}
|
||||
|
||||
}
|
||||
public void setRock(int nbRock){
|
||||
bank.AmountOfRock = nbRock;
|
||||
}
|
||||
public int getRock(){
|
||||
return bank.AmountOfRock;
|
||||
}
|
||||
public void setWood(int nbWood)
|
||||
{
|
||||
bank.AmountOfWood = nbWood;
|
||||
}
|
||||
public int getWood()
|
||||
{
|
||||
return bank.AmountOfWood;
|
||||
}
|
||||
public void setCorpse(int nbCorpse)
|
||||
{
|
||||
bank.AmountOfCorpse = nbCorpse;
|
||||
}
|
||||
public int getCorpse()
|
||||
{
|
||||
return bank.AmountOfCorpse;
|
||||
}
|
||||
public void setMeat(int nbMeat)
|
||||
{
|
||||
bank.AmountOfMeat = nbMeat;
|
||||
}
|
||||
public int getMeat()
|
||||
{
|
||||
return bank.AmountOfMeat;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
public void UpdateView()
|
||||
{
|
||||
viewRock.text = ""+ getRock() +"";
|
||||
viewMeat.text = "" + getMeat() + "";
|
||||
viewWood.text = "" + getWood() + "";
|
||||
viewCorpse.text = "" + getCorpse() + "";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,60 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RessourceView{
|
||||
|
||||
Bank bank;
|
||||
Text viewWood;
|
||||
Text viewRock;
|
||||
Text viewCorpse;
|
||||
Text viewMeat;
|
||||
|
||||
public RessourceView(Bank b, Text viewW, Text viewR, Text viewC, Text viewM)
|
||||
{
|
||||
this.bank = b;
|
||||
this.viewCorpse = viewC;
|
||||
this.viewWood = viewW;
|
||||
this.viewRock = viewR;
|
||||
this.viewMeat = viewM;
|
||||
}
|
||||
|
||||
public void setRock(int nbRock){
|
||||
bank.AmountOfRock = nbRock;
|
||||
}
|
||||
public int getRock(){
|
||||
return bank.AmountOfRock;
|
||||
}
|
||||
public void setWood(int nbWood)
|
||||
{
|
||||
bank.AmountOfWood = nbWood;
|
||||
}
|
||||
public int getWood()
|
||||
{
|
||||
return bank.AmountOfWood;
|
||||
}
|
||||
public void setCorpse(int nbCorpse)
|
||||
{
|
||||
bank.AmountOfCorpse = nbCorpse;
|
||||
}
|
||||
public int getCorpse()
|
||||
{
|
||||
return bank.AmountOfCorpse;
|
||||
}
|
||||
public void setMeat(int nbMeat)
|
||||
{
|
||||
bank.AmountOfMeat = nbMeat;
|
||||
}
|
||||
public int getMeat()
|
||||
{
|
||||
return bank.AmountOfMeat;
|
||||
}
|
||||
|
||||
public void UpdateView()
|
||||
{
|
||||
viewRock.text = ""+ getRock() +"";
|
||||
viewMeat.text = "" + getMeat() + "";
|
||||
viewWood.text = "" + getWood() + "";
|
||||
viewCorpse.text = "" + getCorpse() + "";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user