#include "TypeRegistry.h" #include #include "Animal.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 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()); registerType(new EntityGeneratorFactory()); // entities registerSubType(new AnimalEntityTypeFactory()); } 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(); } }