Example #1
0
        private void GamePacketReceived(GamePacket arg1, NetPeer peer)
        {
            switch (arg1.GameCommand)
            {
            case GameCommand.SEND_HIT:
                _roomsController.CheckPlayerHit(arg1);
                _roomsController.SetPlayerTurn(_roomsController.Rooms.Find(x => x.RoomId == arg1.RoomId));
                break;

            case GameCommand.ATTACK_RECEIVE_HIT_RESULT:
                _roomsController.SendHitResultToPlayers(arg1);
                break;

            case GameCommand.PLAYER_READY_TO_PLAY:
                Log.Information("PlayerReadyToPlay");
                _roomsController.SetPlayerReadyGameState(arg1);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }