123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #include "TypeRegistry.h"
- #include <Datei.h>
- #include "BasicBlocks.h"
- #include "BasicItems.h"
- #include "BasicTool.h"
- #include "BlockFilter.h"
- #include "BlockInstanceGeneratorRule.h"
- #include "BlockTypeGeneratorRule.h"
- #include "Chest.h"
- #include "Dimension.h"
- #include "DimensionGenerator.h"
- #include "FluidBlock.h"
- #include "FluidContainer.h"
- #include "GeneratorRule.h"
- #include "Grass.h"
- #include "GrowingPlant.h"
- #include "JsonExpression.h"
- #include "LightSources.h"
- #include "ModelInfo.h"
- #include "PlaceableProof.h"
- #include "Quest.h"
- #include "Recipie.h"
- #include "TreeSeblingBlock.h"
- #include "TreeTemplate.h"
- TypeRegistry::TypeRegistry()
- : ReferenceCounter()
- {
- // register templates
- registerSubType(new TreeTemplateFactory());
- // register quest datastructures
- registerType(new QuestRequirementStorageType());
- registerType(new QuestStorageType());
- registerType(new QuestPartyType());
- registerType(new QuestType());
- registerType(new QuestCollectionType());
- registerSubType(new QuestRequirementOpenDialogType());
- registerType(new ItemJsonType());
- registerType(new ItemStackInfoType());
- registerSubType(new QuestRewardGiveItemsType());
- // block types
- registerType(new ModelInfoFactory());
- registerSubType(new BasicBlockTypeFactory());
- registerSubType(new AdditionalItemSpawningBlockTypeFactory());
- registerSubType(new BasicLightSourceBlockTypeFactory());
- registerSubType(new ChestBlockTypeFactory());
- registerSubType(new FluidBlockTypeFactory());
- registerSubType(new GrassBlockTypeFactory());
- registerSubType(new GrowingPlantBlockTypeFactory());
- registerSubType(new TreeSeblingBlockTypeFactory());
- // block filter
- registerSubType(new BlockFilterAndFactory());
- registerSubType(new BlockFilterOrFactory());
- registerSubType(new BlockFilterNotFactory());
- registerSubType(new BlockFilterBlockTypeFactory());
- registerSubType(new BlockFilterTypeGroupFactory());
- registerSubType(new BlockFilterMaxHardnessFactory());
- registerSubType(new BlockFilterMinHardnessFactory());
- registerSubType(new BlockFilterMaxHeatFactory());
- // placeable proof
- registerSubType(new PlaceableProofAndFactory());
- registerSubType(new PlaceableProofOrFactory());
- registerSubType(new PlaceableProofNotFactory());
- registerSubType(new PlaceableProofBlockFilterFactory());
- // item types
- registerSubType(new BasicBlockItemTypeFactory());
- registerSubType(new BasicItemTypeFactory());
- registerSubType(new BasicToolItemTypeFactory());
- registerSubType(new FluidContainerItemTypeFactory());
- // item skills
- registerSubType(new XPBasedLevelUpRuleFactory());
- registerType(new DamagingItemSkillConfigFactory());
- registerSubType(new DamagingItemSkillFactory());
- registerType(new BlockReplaceItemSkillConfigFactory());
- registerSubType(new BlockReplaceItemSkillFactory());
- registerType(new FluidContainerItemSkillConfigFactory());
- registerSubType(new FluidContainerItemSkillFactory());
- // reipies
- registerType(new RecipieInputFactory());
- registerType(new RecipieOutputFactory());
- registerSubType(new ShapedRecipieFactory());
- registerSubType(new UnshapedRecipieFactory());
- // item modifiers
- registerSubType(new ConsumeItemModifierFactory());
- registerSubType(new DoNothingModifierFactory());
- registerSubType(new AttributeItemModifierFactory());
- registerSubType(new CombinedItemModifierFactory());
- // item filters
- registerSubType(new CombinedItemFilterFactory());
- registerSubType(new AnyItemFilterFactory());
- registerSubType(new TypeItemFilterFactory());
- registerSubType(new GroupItemFilterFactory());
- // json Expressions
- registerSubType(new JVariableFloatExpressionFactory());
- registerSubType(new JVariableBoolExpressionFactory());
- registerSubType(new JConstantFloatExpressionFactory());
- registerSubType(new JConstantBoolExpressionFactory());
- registerSubType(new JNoiseFloatExpressionFactory());
- registerSubType(new JOperatorFloatExpressionFactory());
- registerSubType(new JBoolOperatorBoolExpressionFactory());
- registerSubType(new JFloatOperatorBoolExpressionFactory());
- registerSubType(new JBlockTypeBoolExpressionFactory());
- // world generator
- registerType(new WorldHeightLayerFactory());
- registerSubType(new BlockTypeGeneratorRuleFactory());
- registerSubType(new BlockInstanceGeneratorRuleFactory());
- registerSubType(new BiomedCavedDimensionGeneratorFactory());
- registerType(new BiomGeneratorFactory());
- registerType(new StructureTemplateCollectionFactory());
- registerSubType(new TreeTemplateFactory());
- }
- void TypeRegistry::writeSyntaxInfo(Framework::Text folderPath) const
- {
- for (Framework::Text* typeId : parsableTypeNames)
- {
- TypeFatoryRef* factory
- = parsableTypes.z(typeId->getText(), typeId->getLength());
- Framework::JSON::Validator::JSONValidator* validator
- = factory->getValidator();
- Framework::Datei syntaxFile(
- new Framework::Text(folderPath + "/" + *typeId + ".xml"));
- syntaxFile.erstellen();
- Framework::Text syntaxContent = validator->zConstraints()->toString();
- syntaxFile.open(Framework::Datei::Style::schreiben);
- syntaxFile.schreibe(syntaxContent, syntaxContent.getLength());
- syntaxFile.close();
- validator->release();
- }
- }
|