示例#1
0
 internal WingAddEvent InvokeEvent(WingAddEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         WingAdd?.Invoke(_api, arg);
     }
     return(arg);
 }
示例#2
0
        public void PostJournalEvent(object sender, JournalEntryBase journalEntry)
        {
            sender = sender ?? this;
            switch (journalEntry)
            {
            case FSDJump jump:
                Location?.Invoke(sender, jump);
                break;

            case Location location:
                Location?.Invoke(sender, location);
                break;

            case Friends friends:
                Friends?.Invoke(sender, friends);
                break;

            case WingInvite wingInvite:
                WingInvite?.Invoke(sender, wingInvite);
                break;

            case WingJoin wingJoin:
                WingJoin?.Invoke(sender, wingJoin);
                break;

            case WingAdd wingAdd:
                WingAdd?.Invoke(sender, wingAdd);
                break;

            case WingLeave wingLeave:
                WingLeave?.Invoke(sender, wingLeave);
                break;

            case null:
                break;

            default:
                log.Warn($"Unmapped journal event '{journalEntry.GetType().Name}'");
                break;
            }
        }