Beispiel #1
0
 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);
         }
     }
 }
Beispiel #2
0
 public int Rate()
 {
     return(_score.Rate());
 }
Beispiel #3
0
 private int EvaluateGame(Game game)
 {
     EvaluationRule.Controller = game.ControllerById(EntityID);
     return(EvaluationRule.Rate());
 }