public MovesSet(MovesSet set, PlanetWars context) : this(set.GetMoves(), set.Score, set.AdviserName, context) { }
public override List<MovesSet> RunAll() { List<MovesSet> movesSet = new List<MovesSet>(); Planets planetsForAdvise = Context.MyEndangeredPlanets(); foreach (Planet planet in planetsForAdvise) { Moves moves = Run(planet); if (moves.Count <= 0) continue; MovesSet set = new MovesSet(moves, 0, GetAdviserName(), Context); //double score = enemyPlanet.GrowthRate() / Context.AverageMovesDistance(moves); double score = 2 * planet.GrowthRate() * (loseTurn > 0 ? loseTurn : Config.ScoreTurns) - set.NumShipsByTurns / set.AverageDistance; set.Score = score; if (loseTurn == 0) { movesSet.Add(set); } else { //todo delete bigger then target Moves newMoves = new Moves(); foreach (Move move in set.GetMoves()) { if (Context.GetPlanet(move.SourceID).NumShips() < Context.GetPlanet(move.DestinationID).NumShips()) newMoves.Add(new Move(move)); } if (newMoves.Count > 0) { set = new MovesSet(newMoves, 0, GetAdviserName(), Context); movesSet.Add(set); } } } return movesSet; }
public void IssueOrder(MovesSet movesSet) { Moves moves = movesSet.GetMoves(); foreach (Move move in moves) { #if LOG Logger.Log(movesSet.AdviserName + ": " + move); #endif IssueOrder(move); } }