Beispiel #1
0
        public OptionNode(OptionNode parent, Game game, int playerId, PlayerTask playerTask)
        {
            _parent    = parent;
            _game      = game.Clone(); // create clone
            _playerId  = playerId;
            PlayerTask = playerTask;

            if (!IsRoot)
            {
                Execute();
            }
        }
Beispiel #2
0
        public void Options(ref Dictionary <string, OptionNode> optionNodes)
        {
            var options = _game.Options(_game.ControllerById(_playerId));

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