當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。