Exemplo n.º 1
0
 public void ReceiveStation(PowerStation powerStation)
 {
     if (PowerStations.Count == MaxPowerStations)
     {
         DiscardPowerStation();
     }
     PowerStations.Add(powerStation);
 }
Exemplo n.º 2
0
        private bool CanPower(PowerStation powerStation)
        {
            switch (powerStation.Type)
            {
            case ResourceType.Coal:
                return(powerStation.Resource <= Resources[ResourceMarket.COAL]);

            case ResourceType.Gas:
                return(powerStation.Resource <= Resources[ResourceMarket.GAS]);

            case ResourceType.Oil:
                return(powerStation.Resource <= Resources[ResourceMarket.OIL]);

            case ResourceType.Nuclear:
                return(powerStation.Resource <= Resources[ResourceMarket.NUCLEAR]);

            default:
                return(true);
            }
        }