Esempio n. 1
0
        protected override void handleSessionMessage(PartyGameSessionMessageTypes type, string data)
        {
            switch (type)
            {
            case PartyGameSessionMessageTypes.SetGameState:
            {
                PartyGameSessionMessages.SetGameState setGameState = jsonService.Deserialize <PartyGameSessionMessages.SetGameState>(data);
                FishBucketState gameStateId = (FishBucketState)setGameState.GameStateId;
                changeState(gameStateId);
                break;
            }

            case PartyGameSessionMessageTypes.SetGameStartPositions:
                handleSetGameStartPositions(jsonService.Deserialize <PartyGameSessionMessages.SetGameStartData>(data));
                break;

            case PartyGameSessionMessageTypes.ShowTurnOutput:
                handleShowTurnOutput(jsonService.Deserialize <PartyGameSessionMessages.ShowTurnOutput>(data));
                break;

            case PartyGameSessionMessageTypes.PlayerTurnStart:
                handlePlayerTurnStart(jsonService.Deserialize <PartyGameSessionMessages.PlayerTurnStart>(data));
                break;

            case PartyGameSessionMessageTypes.PlayerLeftGame:
                handlePlayerLeftGame(jsonService.Deserialize <PartyGameSessionMessages.PlayerLeftGame>(data));
                break;

            case PartyGameSessionMessageTypes.AddItem:
            case PartyGameSessionMessageTypes.RemoveItem:
                break;
            }
        }
Esempio n. 2
0
        protected override void handleSessionMessage(PartyGameSessionMessageTypes type, string data)
        {
            switch (type)
            {
            case PartyGameSessionMessageTypes.SetRole:
            {
                PartyGameSessionMessages.SetRole setRole = jsonService.Deserialize <PartyGameSessionMessages.SetRole>(data);
                role = (ScavengerHuntRoles)setRole.RoleId;
                scavengerHuntData.LocalPlayerRole = role;
                scavengerHuntData.OtherPlayerRole = ((role == ScavengerHuntRoles.Hider) ? ScavengerHuntRoles.Finder : ScavengerHuntRoles.Hider);
                break;
            }

            case PartyGameSessionMessageTypes.SetGameState:
            {
                PartyGameSessionMessages.SetGameState setGameState = jsonService.Deserialize <PartyGameSessionMessages.SetGameState>(data);
                ScavengerHuntState gameStateId = (ScavengerHuntState)setGameState.GameStateId;
                changeState(gameStateId);
                break;
            }

            case PartyGameSessionMessageTypes.RemoveItem:
                handleRemoveItem(jsonService.Deserialize <PartyGameSessionMessages.RemoveItem>(data));
                break;

            case PartyGameSessionMessageTypes.AddItem:
                handleAddItem(jsonService.Deserialize <PartyGameSessionMessages.AddItem>(data));
                break;
            }
        }
Esempio n. 3
0
        protected override void handleSessionMessage(PartyGameSessionMessageTypes type, string data)
        {
            switch (type)
            {
            case PartyGameSessionMessageTypes.SetGameState:
            {
                PartyGameSessionMessages.SetGameState setGameState = jsonService.Deserialize <PartyGameSessionMessages.SetGameState>(data);
                FindFourState gameStateId = (FindFourState)setGameState.GameStateId;
                changeState(gameStateId);
                break;
            }

            case PartyGameSessionMessageTypes.ShowTurnOutput:
                handleShowTurnOutput(jsonService.Deserialize <PartyGameSessionMessages.ShowTurnOutput>(data));
                break;

            case PartyGameSessionMessageTypes.PlayerTurnStart:
                handlePlayerTurnStart(jsonService.Deserialize <PartyGameSessionMessages.PlayerTurnStart>(data));
                break;
            }
        }