Ejemplo n.º 1
0
        public TileElevation(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Elevation = (int)attributes[(int)Attribute.ELEVATION];
            Atleast   = (bool)(attributes[(int)Attribute.ATLEAST] ?? false);
        }
        public PositionalDeploymentConfiguration(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            UnitGroup = (UnitGroup)attributes[(int)Attribute.UNIT_GROUP];
            Matcher   = (Matcher <Tile>)(attributes[(int)Attribute.MATCHER] ?? new EmptyMatcher <Tile>());
        }
Ejemplo n.º 3
0
        public UnitGroup(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Name        = (string)attributes[(int)Attribute.NAME];
            _UnitCounts = (List <UnitCount>)attributes[(int)Attribute.UNIT_COUNTS];
        }
Ejemplo n.º 4
0
        public ParameterizingFormationTemplate(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Features = (List <FormationFeature>)attributes[(int)Attribute.FEATURES];
            Template = (FormationTemplate)attributes[(int)Attribute.TEMPLATE];
        }
Ejemplo n.º 5
0
        public TileRenderer(ParseBlock Block)
        {
            UniqueKey = Block.Name;

            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            FontPath         = (string)attributes[(int)Attribute.FONT_FACE];
            FontFace         = Cardamom.Interface.ClassLibrary.Instance.GetFont(FontPath);
            FontColor        = (Color)attributes[(int)Attribute.FONT_COLOR];
            BaseColor        = (Color)attributes[(int)Attribute.BASE_COLOR];
            _ElevationColors = (Color[])attributes[(int)Attribute.ELEVATION_COLORS];
            _TopColors       = Parse.KeyByEnum <TileBase, Color>(
                (Dictionary <string, Color>)attributes[(int)Attribute.TOP_COLORS]);
            _EdgeColors = Parse.KeyByEnum <TileEdge, Color>(
                (Dictionary <string, Color>)attributes[(int)Attribute.EDGE_COLORS]);
            _OverlayColors = Parse.KeyByEnum <TileEdge, Color>(
                (Dictionary <string, Color>)attributes[(int)Attribute.EDGE_OVERLAY_COLORS]);
            _PathColors = Parse.KeyByEnum <TilePathOverlay, Color>(
                (Dictionary <string, Color>)attributes[(int)Attribute.PATH_COLORS]);
            _PathBorderColors = Parse.KeyByEnum <TilePathOverlay, Color>(
                (Dictionary <string, Color>)attributes[(int)Attribute.PATH_BORDER_COLORS]);
            _PathWidths = Parse.KeyByEnum <TilePathOverlay, float>(
                (Dictionary <string, float>)attributes[(int)Attribute.PATH_WIDTHS]);
            _PathBorderWidths = Parse.KeyByEnum <TilePathOverlay, float>(
                (Dictionary <string, float>)attributes[(int)Attribute.PATH_BORDER_WIDTHS]);
        }
Ejemplo n.º 6
0
        public TilesControlledObjective(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Friendly = (bool)attributes[(int)Attribute.FRIENDLY];
            Matcher  = (Matcher <Tile>)attributes[(int)Attribute.MATCHER];
        }
Ejemplo n.º 7
0
        public ScenarioRules(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            FogOfWar = (bool)(attributes[(int)Attribute.FOG_OF_WAR] ?? false);
            AllowCloseAssaultCapture = (bool)(attributes[(int)Attribute.ALLOW_CLOSE_ASSAULT_CAPTURE] ?? false);
        }
Ejemplo n.º 8
0
        public UnitHasEvacuated(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Direction = (Direction)attributes[(int)Attribute.DIRECTION];
            Matcher   = (Matcher <Tile>)(attributes[(int)Attribute.MATCHER] ?? new EmptyMatcher <Tile>());
        }
Ejemplo n.º 9
0
        public UnitCount(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            UnitConfiguration = (UnitConfiguration)attributes[(int)Attribute.UNIT_CONFIGURATION];
            Count             = (int)attributes[(int)Attribute.COUNT];
        }
Ejemplo n.º 10
0
        public RatioObjective(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Numerator   = (Objective)attributes[(int)Attribute.NUMERATOR];
            Denominator = (Objective)attributes[(int)Attribute.DENOMINATOR];
        }
Ejemplo n.º 11
0
        public TileComponentRules(ParseBlock Block)
        {
            UniqueKey = Block.Name;

            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            IsClear             = (bool)(attributes[(int)Attribute.IS_CLEAR] ?? false);
            DieModifier         = (int)(attributes[(int)Attribute.DIE_MODIFIER] ?? 0);
            RoadMove            = (bool)(attributes[(int)Attribute.ROAD_MOVE] ?? false);
            TreatUnitsAsArmored = (bool)(attributes[(int)Attribute.TREAT_UNITS_AS_ARMORED] ?? false);
            MustAttackAllUnits  = (bool)(attributes[(int)Attribute.MUST_ATTACK_ALL_UNITS] ?? false);

            OverrideBaseMovement = (bool)(attributes[(int)Attribute.OVERRIDE_BASE_MOVEMENT] ?? true);
            DepressedTransition  = (bool)(attributes[(int)Attribute.DEPRESSED_TRANSITION] ?? false);
            BlocksLineOfSight    = (bool)(attributes[(int)Attribute.BLOCKS_LINE_OF_SIGHT] ?? false);
            Concealing           = (bool)(attributes[(int)Attribute.CONCEALING] ?? false);
            LowProfileConcealing = (bool)(attributes[(int)Attribute.LOW_PROFILE_CONCEALING] ?? false);

            _TerrainAttributes = new bool[Enum.GetValues(typeof(TerrainAttribute)).Length];
            foreach (TerrainAttribute attribute in
                     (IEnumerable <TerrainAttribute>)(attributes[(int)Attribute.TERRAIN_ATTRIBUTES]
                                                      ?? Enumerable.Empty <TerrainAttribute>()))
            {
                _TerrainAttributes[(int)attribute] = true;
            }
        }
Ejemplo n.º 12
0
        public BoardConfiguration(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            BoardPath = (string)attributes[(int)Attribute.BOARD_PATH];
            Invert    = (bool)attributes[(int)Attribute.INVERT];
        }
Ejemplo n.º 13
0
        public FactionRenderDetails(ParseBlock Block, string Path)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            _RootPath  = Path;
            _ImagePath = (string)attributes[(int)Attribute.IMAGE_PATH];
        }
Ejemplo n.º 14
0
        public FeatureGenerator(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Generator          = (FunctionFactory)attributes[(int)Attribute.GENERATOR];
            ThresholdGenerator = (FunctionFactory)attributes[(int)Attribute.THRESHOLD_GENERATOR];
        }
Ejemplo n.º 15
0
        public PointsObjective(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Objective = (Objective)attributes[(int)Attribute.OBJECTIVE];
            Points    = (int)(attributes[(int)Attribute.POINTS] ?? 1);
        }
Ejemplo n.º 16
0
        public PathObjective(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Source = (Matcher <Tile>)attributes[(int)Attribute.SOURCE];
            Sink   = (Matcher <Tile>)attributes[(int)Attribute.SINK];
            Path   = (Matcher <Tile>)attributes[(int)Attribute.PATH];
        }
        public ReplicatingFormationTemplate(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Template   = (FormationTemplate)attributes[(int)Attribute.TEMPLATE];
            Count      = (int)(attributes[(int)Attribute.COUNT] ?? 1);
            Regenerate = (bool)(attributes[(int)Attribute.REGENERATE] ?? false);
        }
Ejemplo n.º 18
0
        public TileDistanceFrom(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Matcher  = (Matcher <Tile>)attributes[(int)Attribute.MATCHER];
            Distance = (byte)attributes[(int)Attribute.DISTANCE];
            Atleast  = (bool)(attributes[(int)Attribute.ATLEAST] ?? false);
        }
Ejemplo n.º 19
0
        public VictoryCondition(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute), true);

            Scorers = ((Dictionary <string, object>)attributes[(int)Attribute.OBJECTIVES])
                      .Values.Cast <Objective>().ToList();
            Triggers = (List <ObjectiveSuccessTrigger>)attributes[(int)Attribute.TRIGGERS];
        }
Ejemplo n.º 20
0
        public TriggerObjective(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Objective = (Objective)attributes[(int)Attribute.OBJECTIVE];
            Threshold = (int)attributes[(int)Attribute.THRESHOLD];
            Invert    = (bool)(attributes[(int)Attribute.INVERT] ?? false);
        }
Ejemplo n.º 21
0
        public TurnConfiguration(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Turns           = (byte)attributes[(int)Attribute.TURNS];
            DeploymentOrder = (Sequence)attributes[(int)Attribute.DEPLOYMENT_ORDER];
            TurnOrder       = (Sequence)attributes[(int)Attribute.TURN_ORDER];
        }
        public MapGeneratorConfiguration(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute), true);

            UniqueKey        = Block.Name;
            NameGenerator    = (MarkovGenerator <char>)attributes[(int)Attribute.NAME_GENERATOR];
            TerrainGenerator = (TerrainGeneratorConfiguration)attributes[(int)Attribute.TERRAIN_GENERATOR];
        }
Ejemplo n.º 23
0
        public UnitConfigurationLock(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            UniqueKey          = Block.Name;
            Rarity             = (float)attributes[(int)Attribute.RARITY];
            UnitConfigurations = (List <UnitConfigurationLink>)attributes[(int)Attribute.UNIT_CONFIGURATIONS];
        }
Ejemplo n.º 24
0
        public RandomMapConfiguration(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Width   = (int)attributes[(int)Attribute.WIDTH];
            Height  = (int)attributes[(int)Attribute.HEIGHT];
            Setting = (MatchSetting)attributes[(int)Attribute.MATCH_SETTING];
        }
        public UnitsMatchedObjective(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            Matcher     = (Matcher <Unit>)attributes[(int)Attribute.MATCHER];
            Friendly    = (bool)attributes[(int)Attribute.FRIENDLY];
            CountPoints = (bool)(attributes[(int)Attribute.COUNT_POINTS] ?? false);
        }
        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>());
        }
Ejemplo n.º 27
0
 public Tangible(ParseBlock Block)
 {
     object[] attributes = Block.BreakToAttributes <object>(typeof(Attribute));
     _Name        = (string)attributes[(int)Attribute.NAME];
     _Coefficient = (double)attributes[(int)Attribute.COEFFICIENT];
     _Exponent    = (double)attributes[(int)Attribute.EXPONENT];
     _Decay       = (double)attributes[(int)Attribute.DECAY];
     _Minimum     = (double)attributes[(int)Attribute.MINIMUM];
 }
Ejemplo n.º 28
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());
        }
Ejemplo n.º 29
0
        public UnitConstraints(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            IntroduceYear = (int)(attributes[(int)Attribute.INTRODUCE_YEAR] ?? 0);
            ObsoleteYear  = (int)(attributes[(int)Attribute.OBSOLETE_YEAR] ?? 0);
            Front         = (Front)(attributes[(int)Attribute.FRONT] ?? Front.ALL);
            Environments  = (List <Environment>)(attributes[(int)Attribute.ENVIRONMENTS] ?? new List <Environment>());
        }
Ejemplo n.º 30
0
        public UnitRenderDetails(ParseBlock Block, string Path)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            OverrideDisplayName = (string)attributes[(int)Attribute.OVERRIDE_DISPLAY_NAME];
            OverrideColor       = (Color)(attributes[(int)Attribute.OVERRIDE_COLOR] ?? Color.Black);
            _RootPath           = Path;
            _ImagePath          = (string)attributes[(int)Attribute.IMAGE_PATH];
        }