예제 #1
0
    private void saveGameData()
    {
        GameManager gManager = GameManager.gManager;

        GameDataManager.State gamestate = GameDataManager.buildGameState(gManager);
        int roomBeingOpenedIndex        = (!GameManager.gManager.placerTokens) ? -1 : GameObject.FindGameObjectWithTag("TileRevealedTarget").GetComponent <PlacementTokens>().caseActuelle.transform.parent.GetComponent <TileBehavior>().index;

        managerData = new GameDataManager(gamestate, gManager.activePlayer.index, gManager.actionPoints, gManager.valeurMaxCarteAction, roomBeingOpenedIndex);
    }
예제 #2
0
    private void buildGameProgression()
    {
        if (gamestate.last_packet_id == 0)
        {
            gameprogression = GameDataManager.State.SETUP;
        }
        else
        {
            switch (gamestate.name)
            {
            case "characterChoice":
                Debug.Assert(getDiscoveredTileCount() == 0);
                Debug.Assert(getCharacterPlacedCount() == 0 || getCharacterPlacedCount() == 4);
                if (getViewerCharacterPlacedCount() == 0)
                {
                    gameprogression = GameDataManager.State.PLACEMENT1_FIRST;
                }
                else
                {
                    gameprogression = GameDataManager.State.PLACEMENT1_SECOND;
                }
                break;

            case "placeToken":
                Debug.Assert(getDiscoveredTileCount() == 0);
                Debug.Assert(getCharacterPlacedCount() >= 8 && getCharacterPlacedCount() < 24);
                gameprogression = GameDataManager.State.PLACEMENT2;
                break;

            case "playerChooseCard":
                gameprogression = GameDataManager.State.CHOOSE_ACTION_CARD;
                break;

            case "playerChooseAction":
                gameprogression = GameDataManager.State.PLAY_ACTION;
                break;

            case "discoverRoomPlaceToken":
                if (gamestate.current_player == gamestate.active_players[0])
                {
                    gameprogression = GameDataManager.State.PLACE_TOKEN_FIRST;
                }
                else
                {
                    gameprogression = GameDataManager.State.PLACE_TOKEN_SECOND;
                }
                break;

            case "combatChooseCard":
                if (gamestate.active_players.Count == 2)
                {
                    gameprogression = GameDataManager.State.CHOOSE_COMBAT_CARD_FIRST;
                }
                else
                {
                    gameprogression = GameDataManager.State.CHOOSE_COMBAT_CARD_SECOND;
                }
                break;

            case "movingCharacter":
                gameprogression = GameDataManager.State.SELECTION;
                break;

            case "movingCharacterContinue":
                gameprogression = GameDataManager.State.MOVING;
                break;

            case "gameEnd":
            default:
                Debug.Assert(false);
                gameprogression = GameDataManager.State.GAMEOVER;
                break;
            }
        }
    }