Пример #1
0
 public PlanetRecord?GetPlanet(StarDate time, int planetId)
 {
     return(Planets
            .Where(p => p.Time == time)
            .Where(p => p.PlanetId == planetId)
            .SingleOrDefault());
 }
Пример #2
0
        private void StoreFleet(StarDate time, Fleet fleet)
        {
            var record = new FleetRecord
            {
                Time     = time,
                FleetId  = fleet.Id,
                Position = fleet.Position,
            };

            Fleets.Add(record);
        }
Пример #3
0
        private void StorePlayerView(StarDate time, int playerId, IEnumerable <int> planetIds, IEnumerable <int> fleetIds)
        {
            var record = new PlayerRecord
            {
                Time      = time,
                PlayerId  = playerId,
                PlanetIds = planetIds.ToHashSet(),
                FleetIds  = fleetIds.ToHashSet(),
            };

            Players.Add(record);
        }
Пример #4
0
        private void StorePlanet(StarDate time, Planet planet)
        {
            var record = new PlanetRecord
            {
                Time         = time,
                PlanetId     = planet.Id,
                OwnerId      = planet.Settlement?.OwnerId,
                Population   = planet.Settlement?.Population,
                ScannerRange = planet.Settlement?.Installations.Scanner,
            };

            Planets.Add(record);
        }