Package org.terasology.naming

Examples of org.terasology.naming.Name


            BindsConfig result = new BindsConfig();
            JsonObject inputObj = json.getAsJsonObject();
            for (Map.Entry<String, JsonElement> entry : inputObj.entrySet()) {
                SetMultimap<String, Input> map = context.deserialize(entry.getValue(), SetMultimap.class);
                for (String id : map.keySet()) {
                    SimpleUri uri = new SimpleUri(new Name(entry.getKey()), id);
                    result.data.putAll(uri, map.get(id));
                }
            }
            return result;
        }
View Full Code Here


    @Test
    public void testColorTransformedToTextureUri() throws Exception {
        AssetUri assetUri = TextureUtil.getTextureUriForColor(Color.RED);
        assertEquals(AssetType.TEXTURE, assetUri.getAssetType());
        assertEquals(TerasologyConstants.ENGINE_MODULE, assetUri.getModuleName());
        assertEquals(new Name("color.ff0000ff"), assetUri.getAssetName());

        int red = 0x12;
        int green = 0x3;
        int blue = 0xc4;
        int alpha = 0xe;
        assetUri = TextureUtil.getTextureUriForColor(new Color(red, green, blue, alpha));
        assertEquals(AssetType.TEXTURE, assetUri.getAssetType());
        assertEquals(TerasologyConstants.ENGINE_MODULE, assetUri.getModuleName());
        assertEquals(new Name("color.1203c40e"), assetUri.getAssetName());
    }
View Full Code Here

     *
     * @param moduleName
     * @param objectName
     */
    public SimpleUri(String moduleName, String objectName) {
        this(new Name(moduleName), new Name(objectName));
    }
View Full Code Here

     *
     * @param moduleName
     * @param objectName
     */
    public SimpleUri(Name moduleName, String objectName) {
        this(moduleName, new Name(objectName));
    }
View Full Code Here

     * @param simpleUri
     */
    public SimpleUri(String simpleUri) {
        String[] split = simpleUri.split(MODULE_SEPARATOR, 2);
        if (split.length > 1) {
            moduleName = new Name(split[0]);
            objectName = new Name(split[1]);
        }
    }
View Full Code Here

        return classLookup.values().iterator();
    }

    @Override
    public List<ClassMetadata<? extends T, ?>> getMetadata(String name) {
        return getMetadata(new Name(name));
    }
View Full Code Here

        for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) {
            if (!ComponentSystem.class.isAssignableFrom(type)) {
                logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName());
                continue;
            }
            Name moduleId = environment.getModuleProviding(type);
            RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class);
            if (registerInfo.value().isValidFor(netMode, isHeadless)) {
                systemsByModule.put(moduleId, type);
            }
        }
View Full Code Here

                if (Files.isDirectory(child)) {
                    scanOverrides(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    Path modulePath = relativePath.subpath(0, 1);
                    AssetUri uri = getUri(new Name(modulePath.toString()), modulePath.relativize(relativePath));
                    if (uri != null) {
                        try {
                            addOverride(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load override {}", child, e.getMessage());
View Full Code Here

                if (Files.isDirectory(child)) {
                    scanDeltas(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    Path modulePath = relativePath.subpath(0, 1);
                    AssetUri uri = getUri(new Name(modulePath.toString()), modulePath.relativize(relativePath));
                    if (uri != null) {
                        try {
                            setDelta(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load delta {}", child, e.getMessage());
View Full Code Here

        AssetUri uri = new AssetUri(type, name);
        if (uri.isValid()) {
            return Lists.newArrayList(uri);
        }

        return resolveAll(type, new Name(name));
    }
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.