示例#1
0
 public ArmyConfiguration(SerializationInputStream Stream)
 {
     UniqueKey = Stream.ReadString();
     Faction   = GameData.Factions[Stream.ReadString()];
     Team      = Stream.ReadByte();
     DeploymentConfigurations = Stream.ReadEnumerable(DeploymentConfigurationSerializer.Deserialize).ToList();
     VictoryCondition         = new VictoryCondition(Stream);
 }
示例#2
0
        public ArmyConfiguration(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            UniqueKey = Block.Name;
            Faction   = (Faction)attributes[(int)Attribute.FACTION];
            Team      = (byte)attributes[(int)Attribute.TEAM];
            DeploymentConfigurations = ((List <object>)attributes[(int)Attribute.DEPLOYMENT_CONFIGURATIONS])
                                       .Select(i => (DeploymentConfiguration)i)
                                       .ToList();
            VictoryCondition = (VictoryCondition)attributes[(int)Attribute.VICTORY_CONDITION];
        }
示例#3
0
 public ArmyConfiguration(
     string UniqueKey,
     Faction Faction,
     byte Team,
     IEnumerable <DeploymentConfiguration> DeploymentConfigurations,
     VictoryCondition VictoryCondition)
 {
     this.UniqueKey = UniqueKey;
     this.Faction   = Faction;
     this.Team      = Team;
     this.DeploymentConfigurations = DeploymentConfigurations.ToList();
     this.VictoryCondition         = VictoryCondition;
 }
示例#4
0
 public void SetVictoryCondition(VictoryCondition Condition, Army ForArmy, Match Match)
 {
     _Display.Clear();
     foreach (var objective in Condition.Scorers)
     {
         _Display.Add(
             new Button("objective-header")
         {
             DisplayedString =
                 string.Format(
                     "{0}/{1}",
                     objective.CalculateScore(ForArmy, Match, new Dictionary <Objective, int>()),
                     Condition.GetMaximumScore(objective, ForArmy, Match))
         });
         _Display.Add(
             new Button("objective-regular")
         {
             DisplayedString =
                 ObjectDescriber.Sentencify(
                     ObjectiveDescriber.RemoveScore(ObjectiveDescriber.Describe(objective)))
         });
     }
 }