Package org.terasology.naming

Examples of org.terasology.naming.Name


        try (Reader reader = new InputStreamReader(ModuleManagerFactory.class.getResourceAsStream("/module.txt"))) {
            ModuleMetadata metadata = new ModuleMetadataReader().read(reader);
            moduleManager.getRegistry().add(ClasspathModule.create(metadata, ModuleManagerFactory.class));
        }
        moduleManager.loadEnvironment(
                Sets.newHashSet(moduleManager.getRegistry().getLatestModuleVersion(new Name("engine")),
                        moduleManager.getRegistry().getLatestModuleVersion(new Name("unittest"))), true
        );
        return moduleManager;
    }
View Full Code Here


            refreshSelection();
        }
    }

    private boolean isSelectedGameplayModule(ModuleSelectionInfo target) {
        return target.getMetadata().getId().equals(new Name(config.getDefaultModSelection().getDefaultGameplayModuleName()));
    }
View Full Code Here

            public Module get() {
                // try and be smart about auto selecting a gameplay
                if (selected == null) {
                    // get the default gameplay module from the config.  This is likely to have  a user triggered selection.
                    Module defaultGameplayModule = moduleManager.getRegistry().getLatestModuleVersion(
                            new Name(config.getDefaultModSelection().getDefaultGameplayModuleName()));
                    if (defaultGameplayModule != null) {
                        set(defaultGameplayModule);
                        return selected;
                    }
View Full Code Here

            if (hasBlockFamily(straightUri)) {
                matches.add(straightUri);
            }
        } else {
            for (Name moduleId : Assets.listModules()) {
                BlockUri modUri = new BlockUri(moduleId, new Name(uri));
                if (hasBlockFamily(modUri)) {
                    matches.add(modUri);
                }
            }
        }
View Full Code Here

    private Name moduleName = Name.EMPTY;
    private Name familyName = Name.EMPTY;
    private Name blockIdentifier = Name.EMPTY;

    public BlockUri(String moduleName, String familyName) {
        this(new Name(moduleName), new Name(familyName));
    }
View Full Code Here

        this.moduleName = moduleName;
        this.familyName = familyName;
    }

    public BlockUri(String moduleName, String familyName, String identifier) {
        this(new Name(moduleName), new Name(familyName), new Name(identifier));
    }
View Full Code Here

        this(moduleName, familyName);
        this.blockIdentifier = identifier;
    }

    public BlockUri(String moduleName, String familyName, String shapeModuleName, String shapeName) {
        this(new Name(moduleName), new Name(familyName), new Name(shapeModuleName), new Name(shapeName));
    }
View Full Code Here

        this(moduleName, familyName, identifier);
        this.shape = shape;
    }

    public BlockUri(BlockUri familyUri, String identifier) {
        this(familyUri.moduleName, familyUri.familyName, familyUri.shape, new Name(identifier));
    }
View Full Code Here

    }

    public BlockUri(String uri) {
        String[] split = uri.split(MODULE_SEPARATOR, 4);
        if (split.length > 1) {
            moduleName = new Name(split[0]);
        }
        if (split.length == 4) {
            familyName = new Name(split[1]);
            String shapeModuleName = split[2];
            split = split[3].split(IDENTIFIER_SEPARATOR_REGEX, 2);
            if (split.length > 1) {
                shape = new AssetUri(AssetType.SHAPE, shapeModuleName, split[0]);
                blockIdentifier = new Name(split[1]);
            } else if (split.length == 1) {
                shape = new AssetUri(AssetType.SHAPE, shapeModuleName, split[0]);
            }
        } else if (split.length == 2) {
            split = split[1].split(IDENTIFIER_SEPARATOR_REGEX, 2);
            if (split.length > 1) {
                familyName = new Name(split[0]);
                blockIdentifier = new Name(split[1]);
            } else if (split.length == 1) {
                familyName = new Name(split[0]);
            }
        }
    }
View Full Code Here

            }
        });

        for (Map.Entry<Name, Map<Name, SubtextureData>> atlas : textureAtlases.entrySet()) {
            AtlasData data = new AtlasData(atlas.getValue());
            Assets.generateAsset(new AssetUri(AssetType.ATLAS, atlas.getKey(), new Name("terrain")), data, Atlas.class);
        }
    }
View Full Code Here

TOP

Related Classes of org.terasology.naming.Name

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.