Esempio n. 1
0
        public ArmyConfiguration BuildArmyConfiguration()
        {
            Objective objective =
                new HighestScoreObjective(
                    new UnitsMatchedObjective(new UnitHasStatus(UnitStatus.DESTROYED), false, true));
            int x1   = (Parameters.Team % 2) * Parameters.Parameters.MapSize.X / 2;
            int x2   = (Parameters.Team % 2 + 1) * Parameters.Parameters.MapSize.X / 2;
            var zone = new Polygon(
                new Vector2f[]
            {
                new Vector2f(x1, 0),
                new Vector2f(x2, 0),
                new Vector2f(x2, Parameters.Parameters.MapSize.Y + 1),
                new Vector2f(x1, Parameters.Parameters.MapSize.Y + 1)
            });

            return(new ArmyConfiguration(
                       Id.ToString(),
                       Parameters.Faction,
                       Parameters.Team,
                       Enumerable.Repeat(
                           new PositionalDeploymentConfiguration(
                               new UnitGroup(
                                   Parameters.Faction.Name + " Deployment",
                                   _Units.Select(i => new UnitCount(i.Item1.UnitConfiguration, i.Item2))),
                               new TileWithin(zone))
                           , 1),
                       new VictoryCondition(
                           Enumerable.Repeat(objective, 1),
                           Enumerable.Repeat(
                               new ObjectiveSuccessTrigger(ObjectiveSuccessLevel.VICTORY, 1, false, objective), 1))));
        }
Esempio n. 2
0
 public static string Describe(HighestScoreObjective Objective)
 {
     return(string.Format("the highest {0}", ReplaceScore(Describe(Objective.Metric), "number of")));
 }