public PlanetRecord?GetPlanet(StarDate time, int planetId) { return(Planets .Where(p => p.Time == time) .Where(p => p.PlanetId == planetId) .SingleOrDefault()); }
private void StoreFleet(StarDate time, Fleet fleet) { var record = new FleetRecord { Time = time, FleetId = fleet.Id, Position = fleet.Position, }; Fleets.Add(record); }
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); }
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); }