Exemplo n.º 1
0
 public int IsCapacityOfGroup()
 {
     if (ChargeStations.Any() && ChargeStations.Select(c => c.Connectors).Any())
     {
         return(ChargeStations.Select(c => c.Connectors.Sum(c => c.MaxCurrentAmps)).Sum());
     }
     return(0);
 }
Exemplo n.º 2
0
 internal void PlayerInteract()
 {
     if (ChargeStations.Any(station => station.X == Player.X && station.Y == Player.Y))
     {
         Player.Energy.CurrentSoc = Player.Energy.MaxSoc;
         logger.LogMessage("I feel completely recharged!");
     }
 }
Exemplo n.º 3
0
        private Enemy GenerateEnemy()
        {
            GoRogue.Coord chargePos = map.RandomPosition((coord, value) =>
                                                         value &&
                                                         coord != GoRogue.Coord.Get(Player.X, Player.Y) &&
                                                         !ChargeStations.Any(station =>
                                                                             coord == GoRogue.Coord.Get(station.X, station.Y)));

            return(new Enemy(chargePos.X, chargePos.Y, 'D', new Energy(0, 5))); // TODO: Define enemy fuel levels better
        }
Exemplo n.º 4
0
        private ChargeStation GenerateChargeStation()
        {
            GoRogue.Coord chargePos = map.RandomPosition((coord, value) =>
                                                         value &&
                                                         coord != GoRogue.Coord.Get(Player.X, Player.Y) &&
                                                         !ChargeStations.Any(station =>
                                                                             coord == GoRogue.Coord.Get(station.X, station.Y)));

            return(new ChargeStation(chargePos.X, chargePos.Y, '&'));
        }
Exemplo n.º 5
0
        public void UpdateChargeStation(string name, string chargeStationId, int maxCurrentAmps)
        {
            var charStation = ChargeStations.FirstOrDefault(c => c.Id == chargeStationId);

            if (chargeStationId == null)
            {
                var newchargeStation = new ChargeStation(name);
                var newConnector     = new Connector(newchargeStation.Id, maxCurrentAmps);

                newchargeStation.Connectors.Add(newConnector);

                ChargeStations.Add(newchargeStation);
            }
            else
            {
                charStation.SetName(name);
                var connectors = charStation.Connectors.FirstOrDefault(c => c.ChargeStationId == chargeStationId);
                connectors.SetMaxCurrentApms(maxCurrentAmps);
            }
        }
Exemplo n.º 6
0
 public void AddChargeStation(ChargeStation chargeStation)
 {
     ChargeStations.Add(chargeStation);
 }