Beispiel #1
0
        internal static void Generate()
        {
            // MetaData columns
            var idColumn          = _metadataTable.Table[DataConstants.MetaDataIdColumn].Single();
            var fieldColumn       = _metadataTable.Table[DataConstants.MetaDataFieldColumn].Single();
            var dataSourceColumn  = _metadataTable.Table[DataConstants.MetaDataSlkColumn].Single();
            var repeatColumn      = _metadataTable.Table[DataConstants.MetaDataRepeatColumn].Single();
            var dataColumn        = _metadataTable.Table[DataConstants.MetaDataDataColumn].Single();
            var categoryColumn    = _metadataTable.Table[DataConstants.MetaDataCategoryColumn].Single();
            var displayNameColumn = _metadataTable.Table[DataConstants.MetaDataDisplayNameColumn].Single();
            var typeColumn        = _metadataTable.Table[DataConstants.MetaDataTypeColumn].Single();
            var minValColumn      = _metadataTable.Table[DataConstants.MetaDataMinValColumn].Single();
            var maxValColumn      = _metadataTable.Table[DataConstants.MetaDataMaxValColumn].Single();
            var useSpecificColumn = _metadataTable.Table[DataConstants.MetaDataUseSpecificColumn].Single();

            // Properties
            var properties = _metadataTable.Table
                             .Skip(1)
                             .Select(property => new PropertyModel
            {
                Rawcode        = (string)property[idColumn],
                DataName       = (string)property[fieldColumn],
                DataSource     = (string)property[dataSourceColumn],
                IdentifierName = ObjectApiGenerator.CreatePropertyIdentifierName(
                    (string)property[categoryColumn],
                    (string)property[displayNameColumn]),
                Repeat              = (int)property[repeatColumn],
                Data                = (int)property[dataColumn],
                Type                = (string)property[typeColumn],
                MinVal              = property[minValColumn],
                MaxVal              = property[maxValColumn],
                Specifics           = ((string)property[useSpecificColumn]).GetSpecifics(),
                SpecificUniqueNames = new(),
            })
Beispiel #2
0
        internal static void Generate()
        {
            const int LimitSubclasses = 100;

            // MetaData columns
            var idColumn          = _metadataTable.Table[DataConstants.MetaDataIdColumn].Single();
            var fieldColumn       = _metadataTable.Table[DataConstants.MetaDataFieldColumn].Single();
            var dataSourceColumn  = _metadataTable.Table[DataConstants.MetaDataSlkColumn].Single();
            var categoryColumn    = _metadataTable.Table[DataConstants.MetaDataCategoryColumn].Single();
            var displayNameColumn = _metadataTable.Table[DataConstants.MetaDataDisplayNameColumn].Single();
            var typeColumn        = _metadataTable.Table[DataConstants.MetaDataTypeColumn].Single();
            var minValColumn      = _metadataTable.Table[DataConstants.MetaDataMinValColumn].Single();
            var maxValColumn      = _metadataTable.Table[DataConstants.MetaDataMaxValColumn].Single();
            var useHeroColumn     = _metadataTable.Table[DataConstants.MetaDataUseHeroColumn].Single();
            var useUnitColumn     = _metadataTable.Table[DataConstants.MetaDataUseUnitColumn].Single();
            var useBuildingColumn = _metadataTable.Table[DataConstants.MetaDataUseBuildingColumn].Single();

            var properties = _metadataTable.Table
                             .Skip(1)
                             .Where(property => property[useHeroColumn].ParseBool() || property[useUnitColumn].ParseBool() || property[useBuildingColumn].ParseBool())
                             .Select(property => new PropertyModel
            {
                Rawcode        = (string)property[idColumn],
                DataName       = (string)property[fieldColumn],
                DataSource     = (string)property[dataSourceColumn],
                IdentifierName = ObjectApiGenerator.CreatePropertyIdentifierName(
                    (string)property[categoryColumn],
                    (string)property[displayNameColumn]),
                Type                = (string)property[typeColumn],
                MinVal              = property[minValColumn],
                MaxVal              = property[maxValColumn],
                Specifics           = ImmutableHashSet <int> .Empty,
                SpecificUniqueNames = new(),
            })