Ejemplo n.º 1
0
 private static dynamic ToSystemRepresentation(LocationStateEntity entity)
 {
     return(new
     {
         entity?.TimeStamp,
         Name = entity?.StarSystem_Name,
         Coords = new[] { entity?.StarSystem_Coords_X, entity?.StarSystem_Coords_Y, entity?.StarSystem_Coords_Z }
     });
 }
Ejemplo n.º 2
0
 private static ILocationState ToLocationRepresentation(LocationStateEntity entity)
 {
     if (entity is null)
     {
         return(null);
     }
     return(new LocationState
     {
         TimeStamp = entity.TimeStamp,
         Body = new Body(entity.Body_Name, entity.Body_Type, entity.Body_Docked ?? false),
         SignalSource = new SignalSource(new LocalisedString(entity.SignalSource_Type_Symbol, entity.SignalSource_Type_Text), entity.SignalSource_Threat),
         StarSystem = new StarSystem(entity.StarSystem_Name, new[] { entity.StarSystem_Coords_X, entity.StarSystem_Coords_Y, entity.StarSystem_Coords_Z }),
         Station = new Station(entity.Station_Name, entity.Station_Type),
         SurfaceLocation = new SurfaceLocation(entity.SurfaceLocation_Landed ?? false, entity.SurfaceLocation_Latitude, entity.SurfaceLocation_Longitude)
     });
 }
 private static dynamic ToTrackingRepresentation(SessionStateEntity session, LocationStateEntity location, ShipStateEntity ship)
 {
     return(new
     {
         session?.CommanderName,
         session?.GameMode,
         session?.Group,
         StarSystem = new StarSystem(location?.StarSystem_Name, new decimal[] { location?.StarSystem_Coords_X ?? 0, location?.StarSystem_Coords_Y ?? 0, location?.StarSystem_Coords_Z ?? 0 }),
         Body = new Body(location?.Body_Name, location?.Body_Type, location?.Body_Docked ?? false),
         Station = new Station(location?.Station_Name, location?.Station_Type),
         SignalSource = new SignalSource(new LocalisedString(location?.SignalSource_Type_Symbol, location?.SignalSource_Type_Text), location?.SignalSource_Threat),
         SurfaceLocation = new SurfaceLocation(location?.SurfaceLocation_Landed ?? false, location?.SurfaceLocation_Latitude, location?.SurfaceLocation_Latitude),
         Ship = ship?.Type,
         ship?.HullIntegrity,
         ship?.ShieldsUp
     });
 }
Ejemplo n.º 4
0
 private static dynamic ToLocationRepresentation(string user, string gameVersion, LocationStateEntity entity)
 {
     return(new
     {
         GameVersion = gameVersion,
         CommanderName = user,
         Location = ToLocationRepresentation(entity)
     });
 }