コード例 #1
0
 internal WingInviteEvent InvokeEvent(WingInviteEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         WingInvite?.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;
            }
        }