public bool CheckIfGrowingIsPossible() { if (plantState == null) { plantState = new PlantState(plantType); } return(isReadyToGrow && plantState.SatisfyStats()); }
public void UpdateFertilizationStats(string state) { if (plantState == null) { plantState = new PlantState(plantType); } plantState.UpdateFertilizationState(state); OnDataChange(); }
public void Irrigate() { Debug.Log("He regado esta planta "); if (plantState == null) { plantState = new PlantState(plantType); } irrigationClock.ChangeState(-1); irrigationClock.Reset(); plantState.UpdateIrrigationState(irrigationClock.GetCurrentState()); }
public void Atemperate(float sunIntensity) { if (plantState == null) { plantState = new PlantState(plantType); } if (pot != null) { plantState.UpdatePlantTemperature(pot.GetTransformedTemperature(sunIntensity)); OnDataChange(); } }
public void Fertilizate(string fertilizationType) { if (plantState == null) { plantState = new PlantState(plantType); } if (fertilizationType == plantState.GetDesiredValues().fertilizationType) { fertilizationClock.ChangeState(-1); fertilizationClock.Reset(); plantState.UpdateFertilizationState(fertilizationClock.GetCurrentState()); } }
public void Awake() { if (plantState == null) { plantState = new PlantState(plantType); } plantState.Grow("seeds"); //Initialize clocks irrigationClock.SetTicks(plantState.GetDesiredValues().irrigationRate / irrigationClock.GetStates().Length); fertilizationClock.SetTicks(plantState.GetDesiredValues().fertilizationRate / fertilizationClock.GetStates().Length); growingClock.SetTicks(plantState.GetDesiredValues().growingRate / growingClock.GetStates().Length); irrigationClock.SetName("IrrigationClock" + GetInstanceID()); fertilizationClock.SetName("FertilizationClock" + GetInstanceID()); growingClock.SetName("GrowingClock" + growingClock.gameObject.GetInstanceID()); }