コード例 #1
0
        Task IMultiplayerClient.MatchStarted()
        {
            if (Room == null)
            {
                return(Task.CompletedTask);
            }

            Scheduler.Add(() =>
            {
                if (Room == null)
                {
                    return;
                }

                MatchStarted?.Invoke();
            }, false);

            return(Task.CompletedTask);
        }
コード例 #2
0
        Task IMultiplayerClient.MatchStarted()
        {
            if (Room == null)
            {
                return(Task.CompletedTask);
            }

            Schedule(() =>
            {
                if (Room == null)
                {
                    return;
                }

                PlayingUsers.AddRange(Room.Users.Where(u => u.State == MultiplayerUserState.Playing).Select(u => u.UserID));

                MatchStarted?.Invoke();
            });

            return(Task.CompletedTask);
        }
コード例 #3
0
        private void ChangeMatchState(int matchId, StateEnum state)
        {
            //db
            UoW.MatchRepo.UpdateMatchState(matchId, state);

            //ui
            switch (state)
            {
            case StateEnum.Confirmed:

                break;

            case StateEnum.Playing:
                MatchStarted?.Invoke(matchId);
                break;

            case StateEnum.Ended:
                MatchEnded?.Invoke(matchId);
                break;

            default:
                break;
            }
        }
コード例 #4
0
 protected virtual void OnMatchStarted()
 {
     MatchStarted?.Invoke(this, EventArgs.Empty);
 }
コード例 #5
0
 protected virtual void OnMatchStarted(object source)
 {
     MatchStarted?.Invoke(source, EventArgs.Empty);
 }
コード例 #6
0
        private void HandleCurrentEvents()
        {
            foreach (BaseEvent baseEvent in currentTick.Events)
            {
                switch (baseEvent.Type)
                {
                case EventType.MatchStarted:
                    MatchStarted?.Invoke(this, baseEvent);
                    break;

                case EventType.RoundAnnounceMatchStarted:

                    break;

                case EventType.RoundStart:
                    RoundStart?.Invoke(this, (RoundStartEvent)baseEvent);
                    break;

                case EventType.RoundEnd:
                    RoundEnd?.Invoke(this, (RoundEndEvent)baseEvent);
                    break;

                case EventType.WinPanelMatch:
                    WinPanelMatch?.Invoke(this, baseEvent);
                    break;

                case EventType.RoundFinal:
                    break;

                case EventType.LastRoundHalf:
                    break;

                case EventType.RoundOfficiallyEnd:
                    RoundOfficiallyEnd?.Invoke(this, baseEvent);
                    break;

                case EventType.RoundMVP:
                    RoundMVP?.Invoke(this, (RoundMVPEvent)baseEvent);
                    break;

                case EventType.FreezetimeEnded:
                    FreezetimeEnded?.Invoke(this, baseEvent);
                    break;

                case EventType.PlayerKilled:
                    PlayerKilled?.Invoke(this, (PlayerKilledEvent)baseEvent);
                    break;

                case EventType.PlayerTeam:
                    PlayerTeam?.Invoke(this, (PlayerTeamEvent)baseEvent);
                    break;

                case EventType.WeaponFired:
                    WeaponFired?.Invoke(this, (WeaponFiredEvent)baseEvent);
                    break;

                case EventType.SmokeNadeStarted:
                    SmokeNadeStarted?.Invoke(this, (SmokeNadeStartedEvent)baseEvent);
                    break;

                case EventType.SmokeNadeEnded:
                    SmokeNadeEnded?.Invoke(this, (SmokeNadeEndedEvent)baseEvent);
                    break;

                case EventType.DecoyNadeStarted:
                    DecoyNadeStarted?.Invoke(this, (DecoyNadeStartedEvent)baseEvent);
                    break;

                case EventType.DecoyNadeEnded:
                    DecoyNadeEnded?.Invoke(this, (DecoyNadeEndedEvent)baseEvent);
                    break;

                case EventType.FireNadeStarted:
                    FireNadeStarted?.Invoke(this, (FireNadeStartedEvent)baseEvent);
                    break;

                case EventType.FireNadeWithOwnerStarted:
                    FireNadeWithOwnerStarted?.Invoke(this, (FireNadeWithOwnerStartedEvent)baseEvent);
                    break;

                case EventType.FireNadeEnded:
                    FireNadeEnded?.Invoke(this, (FireNadeEndedEvent)baseEvent);
                    break;

                case EventType.FlashNadeExploded:
                    FlashNadeExploded?.Invoke(this, (FlashNadeExplodedEvent)baseEvent);
                    break;

                case EventType.ExplosiveNadeExploded:
                    ExplosiveNadeExploded?.Invoke(this, (ExplosiveNadeExplodedEvent)baseEvent);
                    break;

                case EventType.NadeReachedTarget:
                    NadeReachedTarget?.Invoke(this, (NadeReachedTargetEvent)baseEvent);
                    break;

                case EventType.BombBeginPlant:
                    BombBeginPlant?.Invoke(this, (BombBeginPlantEvent)baseEvent);
                    break;

                case EventType.BombAbortPlant:
                    BombAbortPlant?.Invoke(this, (BombAbortPlantEvent)baseEvent);
                    break;

                case EventType.BombPlanted:
                    BombPlanted?.Invoke(this, (BombPlantedEvent)baseEvent);
                    break;

                case EventType.BombDefused:
                    BombDefused?.Invoke(this, (BombDefusedEvent)baseEvent);
                    break;

                case EventType.BombExploded:
                    BombExploded?.Invoke(this, (BombExplodedEvent)baseEvent);
                    break;

                case EventType.BombBeginDefuse:
                    BombBeginDefuse?.Invoke(this, (BombBeginDefuseEvent)baseEvent);
                    break;

                case EventType.BombAbortDefuse:
                    BombAbortDefuse?.Invoke(this, (BombAbortDefuseEvent)baseEvent);
                    break;

                case EventType.PlayerHurt:
                    PlayerHurt?.Invoke(this, (PlayerHurtEvent)baseEvent);
                    break;

                case EventType.Blind:
                    Blind?.Invoke(this, (BlindEvent)baseEvent);
                    break;

                case EventType.PlayerBind:
                    PlayerBind?.Invoke(this, (PlayerBindEvent)baseEvent);
                    break;

                case EventType.PlayerDisconnect:
                    PlayerDisconnect?.Invoke(this, (PlayerDisconnectEvent)baseEvent);
                    break;

                case EventType.SayText:
                    SayText?.Invoke(this, (SayTextEvent)baseEvent);
                    break;

                case EventType.SayText2:
                    SayText2?.Invoke(this, (SayText2Event)baseEvent);
                    break;

                case EventType.PlayerJump:
                    PlayerJump?.Invoke(this, (PlayerJumpEvent)baseEvent);
                    break;

                case EventType.PlayerFootstep:
                    PlayerFootstep?.Invoke(this, (PlayerFootstepEvent)baseEvent);
                    break;

                case EventType.OtherDeath:
                    OtherDeath?.Invoke(this, (OtherDeathEvent)baseEvent);
                    break;

                case EventType.EntitySpawned:
                    EntitySpawned?.Invoke(this, (EntitySpawnedEvent)baseEvent);
                    break;

                case EventType.EntityRemoved:
                    EntityRemoved?.Invoke(this, (EntityRemovedEvent)baseEvent);
                    break;

                default:
                    break;
                }
            }
        }
コード例 #7
0
ファイル: MatchControl.xaml.cs プロジェクト: nord-/StoryScore
 protected virtual void OnMatchStarted(EventArgs e)
 {
     MatchStarted?.Invoke(this, e);
 }