Exemplo n.º 1
0
        public override void UnitComplete(float quality)
        {
            if (!Active())
            {
                return;
            }

            ConsumeCostItems();
            var farmPlot = StructureId.GetStructure() as Farm;

            // change to new plant
            if (farmPlot.PlantName != Option.Name)
            {
                farmPlot.PlantName = Option.Name;
                farmPlot.ResetGrowth();
            }
            else
            {
                if (farmPlot.IsMature())
                {
                    farmPlot.SpawnYield();
                    farmPlot.ResetGrowth();
                }
                else
                {
                    farmPlot.Quality += quality;
                }
            }
        }
Exemplo n.º 2
0
 internal Structure GetStructure()
 {
     if (_structure == null)
     {
         _structure = StructureId.GetStructure();
     }
     return(_structure);
 }
Exemplo n.º 3
0
        public override void UnitComplete(float quality)
        {
            ConsumeCostItems();

            var barrel = StructureId.GetStructure() as LiquidContainer;

            barrel.FillLevel = Mathf.Min(barrel.Capacity, barrel.FillLevel + 25);
        }