示例#1
0
    public void Start(Action gameOverCallback)
    {
        _networkManager = Singleton.instance.networkManager;
        _networkManager.onCustomEvent += onCustomEvent;

        _onGameOverCallback = gameOverCallback;

        GameContext context = Singleton.instance.sessionFlags.gameContext;

        _playerList.Clear();
        for (int i = 0; i < context.playerList.Length; ++i)
        {
            if (context.playerList[i].id >= 0)
            {
                _playerList.Add(context.playerList[i]);
            }
        }

        _gameMatchCore = GameMatchCore.Create(
            _playerList,
            context.customerDeck,
            context.ingredientDeck);

        _playFieldController.Start(_gameMatchCore.matchState);
        _setupPlayFieldCallbacks();

        if (PhotonNetwork.isMasterClient)
        {
            _shockClock.Start(
                kShockClockTurnTime,
                kShockClockInterval,
                onShockClockInterval,
                onShockClockFinished);
        }
    }
示例#2
0
    public static GameMatchCore Create(
        List <PlayerState> playerList,
        CardDeck customerDeck,
        CardDeck ingredientDeck)
    {
        GameMatchCore core = new GameMatchCore();

        // Also no commands for starting player hands
        core.matchState = GameMatchState.Create(
            playerList,
            customerDeck,
            ingredientDeck);

        return(core);
    }
示例#3
0
    public void Start(Action gameOverCallback)
    {
        _onGameOverCallback = gameOverCallback;

        GameContext context = Singleton.instance.sessionFlags.gameContext;

        _playerList.Clear();
        _playerList.AddRange(context.playerList);

        _gameMatchCore = GameMatchCore.Create(
            _playerList,
            context.customerDeck,
            context.ingredientDeck);

        _playFieldController.Start(_gameMatchCore.matchState);
        _setupCallbacks();
    }