Пример #1
0
        public StatPropertyParser(StatPropertyScanner scnr, StatDefinitionRepository definitions) : base(scnr)
        {
            StatScanner = scnr;

            if (definitions != null)
            {
                var surfaceTypeEnum = definitions.Enumerations["Surface Type"];
                SurfaceTypeParser = new EnumParser(surfaceTypeEnum);

                var conditionSurfaceTypeEnum = definitions.Enumerations["CUSTOM_ConditionSurfaceType"];
                ConditionSurfaceTypeParser = new EnumParser(conditionSurfaceTypeEnum);

                var surfaceStateEnum = definitions.Enumerations["CUSTOM_SurfaceState"];
                SurfaceStateParser = new EnumParser(surfaceStateEnum);

                var skillTargetConditionEnum = definitions.Enumerations["SkillTargetCondition"];
                SkillTargetConditionParser = new EnumParser(skillTargetConditionEnum);

                SkillConditionsWithArgument = definitions.Enumerations["CUSTOM_SkillCondition_1arg"];

                var requirementEnum = definitions.Enumerations["CUSTOM_Requirement"];
                RequirementParser = new EnumParser(requirementEnum);

                RequirementsWithArgument = definitions.Enumerations["CUSTOM_Requirement_1arg"];
            }
        }
        public StatPropertyParser(StatPropertyScanner scnr, StatDefinitionRepository definitions,
                                  StatValueParserFactory parserFactory) : base(scnr)
        {
            StatScanner = scnr;

            if (definitions != null)
            {
                var surfaceTypeEnum = definitions.Enumerations["Surface Type"];
                SurfaceTypeParser = new EnumParser(surfaceTypeEnum);

                var conditionSurfaceTypeEnum = definitions.Enumerations["CUSTOM_ConditionSurfaceType"];
                ConditionSurfaceTypeParser = new EnumParser(conditionSurfaceTypeEnum);

                var surfaceStateEnum = definitions.Enumerations["CUSTOM_SurfaceState"];
                SurfaceStateParser = new EnumParser(surfaceStateEnum);

                var skillTargetConditionEnum = definitions.Enumerations["SkillTargetCondition"];
                SkillTargetConditionParser = new EnumParser(skillTargetConditionEnum);

                SkillConditionsWithArgument = definitions.Enumerations["CUSTOM_SkillCondition_1arg"];

                var requirementEnum = definitions.Enumerations["CUSTOM_Requirement"];
                RequirementParser = new EnumParser(requirementEnum);

                RequirementsWithArgument = definitions.Enumerations["CUSTOM_Requirement_1arg"];
                EngineStatuses           = definitions.Enumerations["CUSTOM_EngineStatus"];

                StatusParser = parserFactory.CreateReferenceParser(new List <StatReferenceConstraint>
                {
                    new StatReferenceConstraint
                    {
                        StatType = "StatusData"
                    }
                });
            }
        }