Beispiel #1
0
 public QueryResolver(ISeriesEngine seriesEngine, IMissionEngine missionEngine, ILogEngine logEngine, IEventEngine eventEngine)
 {
     _seriesEngine  = seriesEngine;
     _missionEngine = missionEngine;
     _logEngine     = logEngine;
     _eventEngine   = eventEngine;
 }
Beispiel #2
0
        public EventType(IFileEngine fileEngine, IMissionEngine missionEngine, ISeriesEngine seriesEngine)
        {
            Name        = "Event";
            Description = "Major events that occurred during the mission";

            Field(e => e.Id);
            Field(e => e.Text);
            Field(e => e.Timestamp);
            Field <FileType>("file", "Image associated with the series.", resolve: c => fileEngine.GetById(c.Source.FileId));
            Field <MissionType>("mission", "Mission the event occurred on.", resolve: c => missionEngine.GetMission(c.Source.MissionId));
            Field <SeriesType>("series", "Series of missions associated with the event.", resolve: c => seriesEngine.GetSeries(c.Source.SeriesId));
        }
Beispiel #3
0
        public LogType(IMissionEngine missionEngine)
        {
            Name        = "Log";
            Description = "Transcribed logs from a mission";

            // Auto-mapped properties
            Field(s => s.Id);
            Field(s => s.SpeakerName);
            Field(s => s.Text);
            Field(s => s.Timestamp);

            // Custom-mapped properties
            Field <MissionType>("mission", "The mission during which the log was captured", resolve: c => missionEngine.GetMission(c.Source.MissionId));
        }
Beispiel #4
0
        public SeriesType(IMissionEngine missionEngine, IFileEngine fileEngine)
        {
            Name        = "Series";
            Description = "A set of missions that contributed to a larger objective";

            // Auto-mapped properties
            Field(s => s.Id);
            Field(s => s.SeriesName).Description("The name of the series.");

            // Custom-mapped properties
            Field <FileType>("file", "Image associated with the series.", resolve: c => fileEngine.GetById(c.Source.FileId));
            Field <ListGraphType <MissionType> >("missions", "Which missions are part of this series.", resolve: c => missionEngine.GetMissionsBySeriesId(c.Source.Id));
            Field <LongGraphType>("missionCount", "Number of missions that are part of this series.", resolve: c => missionEngine.GetMissionCountBySeriesId(c.Source.Id));
        }
Beispiel #5
0
        public static async Task <Core.Mission> GetOrCreateMission(IMissionEngine missionEngine, string missionName, string missionImage, string seriesId)
        {
            var mission = await missionEngine.GetMissionByName(missionName);

            if (mission == null)
            {
                Core.File file = null;
                if (!string.IsNullOrWhiteSpace(missionImage))
                {
                    file = await FileLoader.GetLocalFile(missionImage);
                }
                mission = await missionEngine.Create(missionName, seriesId, file);

                Console.WriteLine($"Mission Created: {mission.MissionName}-{mission.Id}");
            }
            else
            {
                Console.WriteLine($"Mission Found: {mission.MissionName}-{mission.Id}");
            }
            return(mission);
        }
Beispiel #6
0
 public GeminiLoader(ISeriesEngine seriesEngine, IMissionEngine missionEngine)
 {
     _seriesEngine  = seriesEngine;
     _missionEngine = missionEngine;
 }
Beispiel #7
0
 public MissionController(IMissionEngine seriesEngine)
 {
     _missionEngine = seriesEngine;
 }
Beispiel #8
0
 public ApolloLoader(ISeriesEngine seriesEngine, IMissionEngine missionEngine, ILogEngine logEngine)
 {
     _seriesEngine  = seriesEngine;
     _missionEngine = missionEngine;
     _logEngine     = logEngine;
 }