private bool checkConditionValue(Condition c)
 {
     //data[0] contains a string for the type of value to check, data[1] contains the number.
     string[] data = c.getValue().Split(':');
     //Debug.Log(data[0] + ", " + data[1]);
     if (data[0].Equals("Population"))
     {
         if (int.Parse(data[1]) < tower.getPopulation())
         {
             return(true);
         }
     }
     else if (data[0].Equals("Highest Floor"))
     {
         if (int.Parse(data[1]) < tower.getHighestFloor())
         {
             return(true);
         }
     }
     else if (data[0].Equals("Human Population"))
     {
         if (int.Parse(data[1]) < tower.getHumanPop())
         {
             return(true);
         }
     }
     else if (data[0].Equals("Result"))
     {
     }
     return(false);
 }
Example #2
0
 void Update()
 {
     humanPop.text  = tower.getHumanPop().ToString();
     zombiePop.text = tower.getZombiePop().ToString();
     witchPop.text  = tower.getWitchPop().ToString();
     demonPop.text  = tower.getDemonPop().ToString();
 }