Пример #1
0
        public OptionNode(OptionNode parent, Game game, int playerId, PlayerTask playerTask, IScore scoring)
        {
            _parent    = parent;
            _game      = game.Clone();        // create clone
            _playerId  = playerId;
            PlayerTask = playerTask;
            Scoring    = scoring;

            if (!IsRoot)
            {
                Execute();
            }
        }
Пример #2
0
        public void Options(ref Dictionary <string, OptionNode> optionNodes)
        {
            List <PlayerTask> options = _game.ControllerById(_playerId).Options(/*!_isOpponentTurn*/);

            foreach (PlayerTask option in options)
            {
                var optionNode = new OptionNode(this, _game, _playerId, option, Scoring);
                if (!optionNodes.ContainsKey(optionNode.Hash))
                {
                    optionNodes.Add(optionNode.Hash, optionNode);
                }
            }
        }