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>()); }
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]; }
public ParameterizingFormationTemplate(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); Features = (List <FormationFeature>)attributes[(int)Attribute.FEATURES]; Template = (FormationTemplate)attributes[(int)Attribute.TEMPLATE]; }
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]); }
public TilesControlledObjective(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); Friendly = (bool)attributes[(int)Attribute.FRIENDLY]; Matcher = (Matcher <Tile>)attributes[(int)Attribute.MATCHER]; }
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); }
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>()); }
public UnitCount(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); UnitConfiguration = (UnitConfiguration)attributes[(int)Attribute.UNIT_CONFIGURATION]; Count = (int)attributes[(int)Attribute.COUNT]; }
public RatioObjective(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); Numerator = (Objective)attributes[(int)Attribute.NUMERATOR]; Denominator = (Objective)attributes[(int)Attribute.DENOMINATOR]; }
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; } }
public BoardConfiguration(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); BoardPath = (string)attributes[(int)Attribute.BOARD_PATH]; Invert = (bool)attributes[(int)Attribute.INVERT]; }
public FactionRenderDetails(ParseBlock Block, string Path) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); _RootPath = Path; _ImagePath = (string)attributes[(int)Attribute.IMAGE_PATH]; }
public FeatureGenerator(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); Generator = (FunctionFactory)attributes[(int)Attribute.GENERATOR]; ThresholdGenerator = (FunctionFactory)attributes[(int)Attribute.THRESHOLD_GENERATOR]; }
public PointsObjective(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); Objective = (Objective)attributes[(int)Attribute.OBJECTIVE]; Points = (int)(attributes[(int)Attribute.POINTS] ?? 1); }
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); }
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); }
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]; }
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); }
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]; }
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]; }
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>()); }
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]; }
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 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>()); }
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]; }