private async void PlayerOnRankAsync(object sender, RankEvent e)
        {
            var request = StartRequest();

            if (e.Combat.HasValue)
            {
                request.AddCommand(new SetCommanderRankPilot(RankType.Combat, (int)e.Combat.Value));
            }
            if (e.Cqc.HasValue)
            {
                request.AddCommand(new SetCommanderRankPilot(RankType.Cqc, (int)e.Cqc.Value));
            }
            if (e.Empire.HasValue)
            {
                request.AddCommand(new SetCommanderRankPilot(RankType.Empire, (int)e.Empire.Value));
            }
            if (e.Explore.HasValue)
            {
                request.AddCommand(new SetCommanderRankPilot(RankType.Explore, (int)e.Explore.Value));
            }
            if (e.Federation.HasValue)
            {
                request.AddCommand(new SetCommanderRankPilot(RankType.Federation, (int)e.Federation.Value));
            }
            if (e.Trade.HasValue)
            {
                request.AddCommand(new SetCommanderRankPilot(RankType.Trade, (int)e.Trade.Value));
            }

            await request.SendAsync()
            .ConfigureAwait(false);
        }
Ejemplo n.º 2
0
 internal RankEvent InvokeEvent(RankEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         Rank?.Invoke(_api, arg);
     }
     return(arg);
 }
Ejemplo n.º 3
0
    public void Initialize(StartEvent startEvent, RankEvent rankEvent, OptionEvent optionEvent)
    {
        Initialize();

        this._startEvent = startEvent;
        this._rankEvent = rankEvent;
        this._optionEvent = optionEvent;
    }
Ejemplo n.º 4
0
 private void CallbackRankEvent(RankEvent obj)
 {
     SetValue(() => ProgressRank.Combat, obj.Combat);
     SetValue(() => ProgressRank.Trade, obj.Trade);
     SetValue(() => ProgressRank.Explore, obj.Explore);
     SetValue(() => ProgressRank.Soldier, obj.Soldier);
     SetValue(() => ProgressRank.Exobiologist, obj.Exobiologist);
     SetValue(() => ProgressRank.Empire, obj.Empire);
     SetValue(() => ProgressRank.Federation, obj.Federation);
     SetValue(() => ProgressRank.Cqc, obj.Cqc);
 }
Ejemplo n.º 5
0
 private void AssertEvent(RankEvent @event)
 {
     Assert.NotNull(@event);
     Assert.Equal(DateTime.Parse("2016-06-10T14:32:03Z"), @event.Timestamp);
     Assert.Equal("Rank", @event.Event);
     Assert.Equal(CombatRank.Novice, @event.Combat);
     Assert.Equal(TradeRank.Peddler, @event.Trade);
     Assert.Equal(ExplorationRank.Pathfinder, @event.Explore);
     Assert.Equal(EmpireRank.Outsider, @event.Empire);
     Assert.Equal(FederationRank.Midshipman, @event.Federation);
     Assert.Equal(CqcRank.Helpless, @event.Cqc);
 }
Ejemplo n.º 6
0
 internal void InvokeRankEvent(RankEvent arg)
 {
     RankEvent?.Invoke(this, arg);
 }
Ejemplo n.º 7
0
 internal void InvokeRankEvent(RankEvent arg) => RankEvent?.Invoke(null, arg);