//this method sets in system values and their initial values. the reason we are passing // values instead of having them be blank is to have the ability to restore the system to any point of desired // including pollution level values. Please set the values to 0 at the start of the game public void Start() { temp = DataBaseManager.instance.getConsequencesData(); load(); countTrees(); previousCheck = Time.time; }
public ConsequencesData GetConsequencesInfo() { ConsequencesData temp = null; if (ConsequencesDatas.Count > 0) { temp = ConsequencesDatas[0]; } if (temp == null) { temp = new ConsequencesData(); temp.airPollution = 0; temp.waterPollution = 0; temp.landPollution = 0; temp.totalPollution = 0; temp.Co2Level = 0.045; temp.O2Level = 0.195; temp.soilFertility = 10; temp.air = 1; temp.otherGasses = temp.air - temp.Co2Level - temp.O2Level; temp.flowersAndGrass = 5; ConsequencesDatas.Add(temp); } return(temp); }
public void updateConsueqncesValues(double air, double Co2Level, double O2Level, double soilFertility, double flowersAndGrass, double otherGasses, double totalPollution, double airPollution, double waterPollution, double landPollution) { ConsequencesData temp = ConsequencesDatas[0]; if (ConsequencesDatas.Count > 0) { ConsequencesDatas[0].airPollution = airPollution; ConsequencesDatas[0].waterPollution = waterPollution; ConsequencesDatas[0].landPollution = landPollution; ConsequencesDatas[0].totalPollution = totalPollution; ConsequencesDatas[0].Co2Level = Co2Level; ConsequencesDatas[0].O2Level = O2Level; ConsequencesDatas[0].soilFertility = soilFertility; ConsequencesDatas[0].air = air; ConsequencesDatas[0].otherGasses = otherGasses; ConsequencesDatas[0].flowersAndGrass = flowersAndGrass; } if (temp == null) { temp = new ConsequencesData(); temp.airPollution = airPollution; temp.waterPollution = waterPollution; temp.landPollution = landPollution; temp.totalPollution = totalPollution; temp.Co2Level = Co2Level; temp.O2Level = O2Level; temp.soilFertility = soilFertility; temp.air = air; temp.otherGasses = otherGasses; temp.flowersAndGrass = flowersAndGrass; ConsequencesDatas.Add(temp); user = new UserData(); } }