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

            Fleets.Add(record);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }