示例#1
0
 public BattleResult(List<Player> homePlayers, List<Player> awayPlayers, string type, GameArea area, bool homeAttack, RandomGenerator generator)
 {
     HomePlayers = homePlayers.Select(player => player.Clone()).ToList();
     AwayPlayers = awayPlayers.Select(player => player.Clone()).ToList();
     Area = area;
     Type = type;
     IsHomeAttacking = homeAttack;
     _generator = generator;
     Execute();
 }
示例#2
0
 public BattleResult(List<Player> homePlayers, List<Player> awayPlayers, string type, GameArea area, bool homeAttack)
     : this(homePlayers, awayPlayers, type, area, homeAttack, new RandomGenerator())
 {
 }
示例#3
0
 private void Movement(TacticCard tacticCard, bool homePlayerAttacks, GameArea area, Node node)
 {
     var movement = tacticCard.Movements.SingleOrDefault(x => x.Start.X == node.X && x.Start.Y == node.Y);
     if (movement != null) {
         var nextArea = Areas.Single(x => x.X == movement.End.X && x.Y == movement.End.Y);
         if (homePlayerAttacks) {
             var player = area.HomePlayers.First();
             area.HomePlayers.Remove(player);
             nextArea.AddHomePlayer(player);
         }
         else {
             var player = area.AwayPlayers.First();
             area.AwayPlayers.Remove(player);
             nextArea.AddAwayPlayer(player);
         }
     }
 }