public FilteringFormationTemplate(
     FormationTemplate Template, UnitConstraints Constraints, IEnumerable <FormationFeature> Features)
 {
     this.Template    = Template;
     this.Constraints = Constraints;
     this.Features    = Features.ToList();
 }
Пример #2
0
 public UnitConfigurationLink(SerializationInputStream Stream)
 {
     UniqueKey         = Stream.ReadString();
     Faction           = Stream.ReadObject(i => new Faction(i), false, true);
     UnitConfiguration = Stream.ReadObject(i => new UnitConfiguration(i), false, true);
     Constraints       = new UnitConstraints(Stream);
 }
        public FilteringFormationTemplate(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Template    = (FormationTemplate)attributes[(int)Attribute.TEMPLATE];
            Constraints = (UnitConstraints)(attributes[(int)Attribute.CONSTRAINTS] ?? new UnitConstraints());
            Features    = (List <FormationFeature>)(attributes[(int)Attribute.FEATURES] ?? new List <FormationFeature>());
        }
Пример #4
0
        public UnitConfigurationLink(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            UniqueKey         = Block.Name;
            Faction           = (Faction)attributes[(int)Attribute.FACTION];
            UnitConfiguration = (UnitConfiguration)attributes[(int)Attribute.UNIT_CONFIGURATION];
            Constraints       = (UnitConstraints)(attributes[(int)Attribute.CONSTRAINTS] ?? new UnitConstraints());
        }
 public bool Matches(UnitConstraints Constraints)
 {
     if (Setting.Front != Front.ALL && Constraints.Front != Front.ALL && Setting.Front != Constraints.Front)
     {
         return(false);
     }
     if (Constraints.IntroduceYear > 0 && Year < Constraints.IntroduceYear)
     {
         return(false);
     }
     if (Constraints.ObsoleteYear > 0 && Year > Constraints.ObsoleteYear)
     {
         return(false);
     }
     if (Constraints.Environments.Count > 0 && !Constraints.Environments.Contains(Setting.Environment))
     {
         return(false);
     }
     return(true);
 }
 public bool Matches(UnitConstraints Constraints)
 {
     return(Parameters.Parameters.Matches(Constraints));
 }