Exemplo n.º 1
0
        /// <summary>
        /// Create a moon job for a moon pull calendar event.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        IJob MoonJobFactory(EsiCalendarEvent e)
        {
            SystemMoon moon = MoonParser.Parse(e.Title.Split(' '));

            if (!TryGetMoon(moon, out MoonComposition moonComp))
            {
                throw new NullReferenceException("Moon not found");
            }

            return(new MoonJob("MoonModule", moonComp.Name, e.EventDate - DateTime.UtcNow - new TimeSpan(0, 10, 0)));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Check if calendar event is for a moon pull.
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 bool IsMoonEvent(EsiCalendarEvent e)
 {
     return(this.MoonParser.TryParse(e.Title.Split(' '), out SystemMoon moon) && TryGetMoon(moon, out _));
 }