public Node(Game game, Node parent, int playerId, PlayerTask task, IScore score) { _game = game.Clone(); _parent = parent; if (parent != null) { parent.children.Add(this); } _playerId = playerId; this.task = task; _score = score; if (task != null) { _game.Process(task); hash = _game.Hash(GameTag.LAST_CARD_PLAYED, GameTag.ENTITY_ID); } if (_game.State != State.RUNNING | _game.CurrentPlayer.Id != _playerId) { _score.Controller = _game.ControllerById(playerId); value = _score.Rate(); if (_parent != null) { _parent.Propagate(value); } } }
public int Rate() { return(_score.Rate()); }
private int EvaluateGame(Game game) { EvaluationRule.Controller = game.ControllerById(EntityID); return(EvaluationRule.Rate()); }