Example #1
0
        public void Process(PlayerLoaded playerLoaded)
        {
            if (playerLoaded.Token.IsCancellationRequested)
            {
                return;
            }

            var playerContext = new PlayerContex(playerLoaded.StoreData, playerLoaded.Output);

            state.Players.Add(playerContext.Id, playerContext);

            IAreaHandler handler = playerContext.PlayerType == PlayerType.Bot
                ? new StasisAreaHandler(playerContext.Id, state)
                : (playerLoaded.StoreData.IsActivated
                        ? (IAreaHandler) new ReturnAreaHandler(playerContext.Id, state)
                        : new WelcomeAreaHandler(playerContext.Id, state));

            playerContext.SetHandler(handler);
        }
Example #2
0
 public MazePlayer(PlayerContex playerContex)
 {
     this.playerContex = playerContex;
 }