当前位置: 首页>>代码示例>>Java>>正文


Java ObjectMap.values方法代码示例

本文整理汇总了Java中com.badlogic.gdx.utils.ObjectMap.values方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectMap.values方法的具体用法?Java ObjectMap.values怎么用?Java ObjectMap.values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.utils.ObjectMap的用法示例。


在下文中一共展示了ObjectMap.values方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runValidation

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
@Override
public void runValidation() {

    FileHandle svgFolder = validationSkin.skinFolder.child("svg");
    FileHandle[] files = svgFolder.list();

    ObjectMap<java.lang.String, ScaledSvg> registed = validationSkin.getAll(ScaledSvg.class);

    Array<String> neadedList = new Array<String>();
    for (ScaledSvg scaledSvg : registed.values()) {
        neadedList.add(scaledSvg.path);
    }

    Array<String> svgList = new Array<String>();
    for (FileHandle file : files) {
        svgList.add("svg/" + file.name());
    }

    for (String test : neadedList) {
        svgList.removeValue(test, true);
    }

    StringBuilder warnMassageBuilder = new StringBuilder();
    if (svgList.size > 0) {
        warnMassageBuilder.append("Unused *.svg files : \n\n");
        for (String unusedFile : svgList) {
            warnMassageBuilder.append(unusedFile);
            warnMassageBuilder.append("\n");
        }
        warnMsg = warnMassageBuilder.toString();
    }

}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:34,代码来源:Validate_UnusedSvgFiles.java

示例2: Professions

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
public Professions(ObjectMap<String, ProfessionDescription> data) {
    this.data = data;
    for (ProfessionDescription a : data.values()) {
        ProfessionDescription prev = byId.put(a.id, a);
        if (prev != null) throw new IllegalStateException("Ids of " + prev.name + " and " + a.name + " clash: " + a.id);
    }
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:8,代码来源:Professions.java

示例3: Items

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
public Items(ObjectMap<String, Item> data) {
    this.data = data;
    for (Item a : data.values()) {
        if (a.id == null) throw new IllegalStateException("item " + a.name + " has no id!");
        Item prev = byId.put(a.id, a);
        if (prev != null) throw new IllegalStateException("Ids of " + prev.name + " and " + a.name + " clash: " + a.id);
    }
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:9,代码来源:Items.java

示例4: Abilities

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
public Abilities(ObjectMap<String, Ability> data) {
    this.data = data;
    for (Ability a : data.values()) {
        Ability prev = byId.put(a.id, a);
        if (prev != null) throw new IllegalStateException("Ids of " + prev.name + " and " + a.name + " clash: " + a.id);
    }
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:8,代码来源:Abilities.java

示例5: getDependencies

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, SkinParameter parameter) {
	sounds = new Array<AssetDescriptor<Sound>>();
	
	ObjectMap<String, FileHandle> soundFiles = Assets.getAssetFiles(
			file.parent().child("sounds").path(), null, file.type());
	
	for (FileHandle soundFile : soundFiles.values()) {
		AssetDescriptor<Sound> ad = new AssetDescriptor<Sound>(soundFile, Sound.class);
		sounds.add(ad);
	}
	
	return super.getDependencies(fileName, file, parameter);
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:16,代码来源:SkinLoaderWithSounds.java

示例6: writeAllLocationsToXML

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
private static void writeAllLocationsToXML(XmlWriter writer, ObjectMap<String, GameLocation> locations) throws IOException {
	for (GameLocation loc : locations.values()) {
		if (loc instanceof GameMap) {
			writer.element(XML_LOCATIONS).attribute(XML_MAP, loc.getId());
			writer.element(loc.getClass().getName());
			loc.writeToXML(writer);
			writer.pop();
			((GameMap) loc).writeAllLocationsToXML(writer);
			writer.pop();
		}
	}
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:13,代码来源:GameSaver.java

示例7: createTextureAtlasRegions

import com.badlogic.gdx.utils.ObjectMap; //导入方法依赖的package包/类
public static LinkedHashMap<Object, TextureRegion> createTextureAtlasRegions() {
        // create TextureRegions from all Bitmap symbols
        LinkedHashMap<Object, TextureRegion> textureRegionMap = new LinkedHashMap<>();
        ObjectMap<String, MapWayPointItemStyle> list = VisUI.getSkin().getAll(MapWayPointItemStyle.class);
        Array<Bitmap> bitmapList = new Array<>();
        for (MapWayPointItemStyle style : list.values()) {
            if (style.small != null) if (!bitmapList.contains(style.small, true)) bitmapList.add(style.small);
            if (style.middle != null) if (!bitmapList.contains(style.middle, true)) bitmapList.add(style.middle);
            if (style.large != null) if (!bitmapList.contains(style.large, true)) bitmapList.add(style.large);
        }

        //add Bitmaps from MapArrowStyle
        MapArrowStyle mapArrowStyle = null;
        try {
            mapArrowStyle = VisUI.getSkin().get("myLocation", MapArrowStyle.class);
        } catch (Exception e) {
            log.error("get MapArrowStyle 'myLocation'", e);
        }

        if (mapArrowStyle != null) {
            if (mapArrowStyle.myLocation != null) bitmapList.add(mapArrowStyle.myLocation);
            if (mapArrowStyle.myLocationTransparent != null) bitmapList.add(mapArrowStyle.myLocationTransparent);
            if (mapArrowStyle.myLocationCar != null) bitmapList.add(mapArrowStyle.myLocationCar);
        }


        LinkedHashMap<Object, Bitmap> input = new LinkedHashMap<>();
        for (Bitmap bmp : bitmapList) {
            input.put(((GetName) bmp).getName(), bmp);
        }
        ArrayList<TextureAtlas> atlasList = new ArrayList<>();
        boolean flipped = CanvasAdapter.platform == Platform.IOS;
        System.out.print("create MapTextureAtlas with flipped Y? " + flipped);
        TextureAtlasUtils.createTextureRegions(input, textureRegionMap, atlasList, false,
                flipped);


//        if (false) {//Debug write atlas Bitmap to tmp folder
//            int count = 0;
//            for (TextureAtlas atlas : atlasList) {
//                byte[] data = atlas.texture.bitmap.getPngEncodedData();
//                Pixmap pixmap = new Pixmap(data, 0, data.length);
//                FileHandle file = Gdx.files.absolute(CB.WorkPath + "/user/temp/testAtlas" + count++ + ".png");
//                PixmapIO.writePNG(file, pixmap);
//                pixmap.dispose();
//            }
//        }
        return textureRegionMap;
    }
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:50,代码来源:MapView.java


注:本文中的com.badlogic.gdx.utils.ObjectMap.values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。