public OptionNode(OptionNode parent, Game game, int playerId, PlayerTask playerTask) { _parent = parent; _game = game.Clone(); // create clone _playerId = playerId; PlayerTask = playerTask; if (!IsRoot) { Execute(); } }
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); } } }