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


Java Json.readValue方法代码示例

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


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

示例1: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    try {
        colors = json.readValue("colors", Array.class, jsonData);
        fonts = json.readValue("fonts", Array.class, jsonData);
        classStyleMap = new OrderedMap<>();
        for (JsonValue data : jsonData.get("classStyleMap").iterator()) {
            classStyleMap.put(ClassReflection.forName(data.name), json.readValue(Array.class, data));
        }
        for (Array<StyleData> styleDatas : classStyleMap.values()) {
            for (StyleData styleData : styleDatas) {
                styleData.jsonData = this;
            }
        }
        customClasses = json.readValue("customClasses", Array.class, CustomClass.class, new Array<>(), jsonData);
        for (CustomClass customClass : customClasses) {
            customClass.setMain(main);
        }
    } catch (ReflectionException e) {
        Gdx.app.log(getClass().getName(), "Error parsing json data during file read", e);
        main.getDialogFactory().showDialogError("Error while reading file...", "Error while attempting to read save file.\nPlease ensure that file is not corrupted.\n\nOpen error log?");
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:24,代码来源:JsonData.java

示例2: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    minRadius = json.readValue("minimumRadius", Float.class, jsonData);
    maxRadius = json.readValue("maximumRadius", Float.class, jsonData);
    angularVelocity = json.readValue("angularVelocity", Float.class, jsonData);
    zTilt = json.readValue("zTilt", Float.class, jsonData);
    xTilt = json.readValue("xTilt", Float.class, jsonData);
    colors = json.readValue("colorGroup", ColorGroup.class, jsonData);

    this.baseObjectCount = json.readValue("objectCount", Integer.class, jsonData);
    objects = new Array<>(baseObjectCount);
}
 
开发者ID:ZKasica,项目名称:Planet-Generator,代码行数:13,代码来源:Ring.java

示例3: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    super.read(json, jsonData);
    setSprite(new Sprite());
    int size = json.readValue("size", Integer.class, jsonData);
    getSprite().setSize(size, size);
    int x = json.readValue("xPos", Integer.class, jsonData);
    int y = json.readValue("yPos", Integer.class, jsonData);
    getSprite().setPosition(x, y);
}
 
开发者ID:ZKasica,项目名称:Planet-Generator,代码行数:11,代码来源:Star.java

示例4: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    super.read(json, jsonData);
    angularVelocity = json.readValue("angularVelocity", Float.class, jsonData);
    zTilt = json.readValue("zTilt", Float.class, jsonData);
    xTilt = json.readValue("xTilt", Float.class, jsonData);
    radius = json.readValue("radius", Float.class, jsonData);
    angle = json.readValue("angle", Float.class, jsonData);
    yOffset = json.readValue("yOffset", Float.class, jsonData);
    initializeMatrices();
}
 
开发者ID:ZKasica,项目名称:Planet-Generator,代码行数:12,代码来源:Orbiter.java

示例5: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    super.read(json, jsonData);
    texture = json.readValue("texture", String.class, jsonData);
    getSprite().setSize(getSize(), getSize());
    radius = getSprite().getWidth()/2;
}
 
开发者ID:ZKasica,项目名称:Planet-Generator,代码行数:8,代码来源:Planet.java

示例6: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read (Json json, JsonValue jsonMap) {
	name = json.readValue("name", String.class, jsonMap);
	emitter = json.readValue("emitter", Emitter.class, jsonMap);
	influencers.addAll(json.readValue("influencers", Array.class, Influencer.class, jsonMap));
	renderer = json.readValue("renderer", ParticleControllerRenderer.class, jsonMap);
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:8,代码来源:ParticleController.java

示例7: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    if (!jsonData.get("file").isNull()) {
        file = new FileHandle(jsonData.getString("file"));
    }
    bgColor = json.readValue("bgColor", Color.class, jsonData);
    visible = json.readValue("visible", Boolean.TYPE, jsonData);
    tint = json.readValue("tint", Color.class, jsonData);
    tintName = json.readValue("tintName", String.class, jsonData);
    name = json.readValue("name", String.class, jsonData);
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:12,代码来源:DrawableData.java

示例8: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    fullyQualifiedName = jsonData.getString("fullyQualifiedName");
    displayName = jsonData.getString("displayName");
    styles = json.readValue("styles", Array.class, CustomStyle.class, jsonData);
    for (CustomStyle style : styles) {
        style.setParentClass(this);
    }
    templateStyle = json.readValue("templateStyle", CustomStyle.class, jsonData);
    templateStyle.setParentClass(this);
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:12,代码来源:CustomClass.java

示例9: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    name = jsonData.getString("name");
    properties = json.readValue("properties", Array.class, CustomProperty.class, jsonData);
    for (CustomProperty property : properties) {
        property.setParentStyle(this);
    }
    deletable = jsonData.getBoolean("deletable");
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:10,代码来源:CustomStyle.java

示例10: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonValue) {
    preferences = json.readValue("preferences", ObjectMap.class, jsonValue);
    jsonData.set(json.readValue("jsonData", JsonData.class, jsonValue));
    atlasData.set(json.readValue("atlasData", AtlasData.class, jsonValue));
    if (!jsonValue.get("saveFile").isNull()) {
        saveFile = new FileHandle(jsonValue.getString("saveFile"));
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:10,代码来源:ProjectData.java

示例11: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    name = jsonData.getString("name");
    properties = json.readValue("properties", OrderedMap.class, jsonData);
    deletable = jsonData.getBoolean("deletable");
    try {
        clazz = ClassReflection.forName(jsonData.getString("clazz"));
    } catch (ReflectionException ex) {
        Gdx.app.error(getClass().toString(), "Error reading from serialized object" , ex);
        main.getDialogFactory().showDialogError("Read Error...","Error reading from serialized object.\n\nOpen log?");
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:13,代码来源:StyleData.java

示例12: getLevelTables

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
static public Array<LevelTable> getLevelTables(String configFilePath){
    Json json = new Json();
    Array<LevelTable> levelTable = new Array<LevelTable>();

    ArrayList<JsonValue> list = json.fromJson(ArrayList.class, Gdx.files.internal(configFilePath));

    for (JsonValue jsonVal : list) {
        LevelTable table = json.readValue(LevelTable.class, jsonVal);
        levelTable.add(table);
    }

    return levelTable;
}
 
开发者ID:Mignet,项目名称:Inspiration,代码行数:14,代码来源:LevelTable.java

示例13: getMonsterZones

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
static public Hashtable<String, Array<MonsterFactory.MonsterType>> getMonsterZones(String configFilePath){
    Json json = new Json();
    Hashtable<String, Array<MonsterFactory.MonsterType>> monsterZones = new Hashtable<String, Array<MonsterFactory.MonsterType>>();

    ArrayList<JsonValue> list = json.fromJson(ArrayList.class, Gdx.files.internal(configFilePath));

    for (JsonValue jsonVal : list) {
        MonsterZone zone = json.readValue(MonsterZone.class, jsonVal);
        monsterZones.put(zone.getZoneID(), zone.getMonsters());
    }

    return monsterZones;
}
 
开发者ID:Mignet,项目名称:Inspiration,代码行数:14,代码来源:MonsterZone.java

示例14: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    cloudObjects = json.readValue("cloudObjects", Array.class, new Array(), jsonData);
}
 
开发者ID:ZKasica,项目名称:Planet-Generator,代码行数:5,代码来源:Cloud.java

示例15: read

import com.badlogic.gdx.utils.Json; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
    size = json.readValue("size", Integer.class, jsonData);
    color = json.readValue("color", Integer.class, jsonData);
    drawColor = new Color(color);
}
 
开发者ID:ZKasica,项目名称:Planet-Generator,代码行数:7,代码来源:SpaceObject.java


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