com.badlogic.gdx.utils.Json.writeArrayEnd()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中com.badlogic.gdx.utils.Json.writeArrayEnd()方法的一些代码示例,展示了Json.writeArrayEnd()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Json.writeArrayEnd()方法的具体详情如下:
包路径:com.badlogic.gdx.utils.Json
类名称:Json
方法名:writeArrayEnd

Json.writeArrayEnd介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

for (int i = 0, n = array.size; i < n; i++)
  writeValue(array.get(i), elementType, null);
writeArrayEnd();
return;
for (int i = 0, n = queue.size; i < n; i++)
  writeValue(queue.get(i), elementType, null);
writeArrayEnd();
return;
  for (Object item : (Collection)value)
    writeValue(item, elementType, null);
  writeArrayEnd();
  writeObjectEnd();
} else {
  for (Object item : (Collection)value)
    writeValue(item, elementType, null);
  writeArrayEnd();
for (int i = 0; i < length; i++)
  writeValue(ArrayReflection.get(value, i), elementType, null);
writeArrayEnd();
return;

代码示例来源:origin: libgdx/libgdx

for (int i = 0, n = array.size; i < n; i++)
  writeValue(array.get(i), elementType, null);
writeArrayEnd();
return;
for (int i = 0, n = queue.size; i < n; i++)
  writeValue(queue.get(i), elementType, null);
writeArrayEnd();
return;
  for (Object item : (Collection)value)
    writeValue(item, elementType, null);
  writeArrayEnd();
  writeObjectEnd();
} else {
  for (Object item : (Collection)value)
    writeValue(item, elementType, null);
  writeArrayEnd();
for (int i = 0; i < length; i++)
  writeValue(ArrayReflection.get(value, i), elementType, null);
writeArrayEnd();
return;

代码示例来源:origin: junkdog/artemis-odb

@Override
public void write(Json json, ArchetypeMapper.TransmuterEntry object, Class knownType) {
  json.writeArrayStart();
  for (int i = 0; i < object.componentTypes.size(); i++) {
    Class<? extends Component> type = object.componentTypes.get(i);
    String name = identifiers.typeToName.get(type);
    json.writeValue(name);
  }
  json.writeArrayEnd();
}

代码示例来源:origin: junkdog/artemis-odb

@Override
public void write(Json json, Bag bag, Class knownType) {
  json.writeArrayStart();
  for (Object item : bag)
    json.writeValue(item);
  json.writeArrayEnd();
}

代码示例来源:origin: SquidPony/SquidLib

@Override
public void write(Json json, char[][] object, Class knownType) {
  if(object == null)
  {
    json.writeValue(null);
    return;
  }
  int sz = object.length;
  json.writeArrayStart();
  for (int i = 0; i < sz; i++) {
    json.writeValue(String.valueOf(object[i]));
  }
  json.writeArrayEnd();
}

代码示例来源:origin: org.mini2Dx/mini2Dx-core

private <T> void writeArray(Field field, Object array, Json json) throws SerializationException {
  if (field != null) {
    json.writeArrayStart(field.getName());
  } else {
    json.writeArrayStart();
  }
  
  int arrayLength = Array.getLength(array);
  for (int i = 0; i < arrayLength; i++) {
    writeObject(field, Array.get(array, i), null, json);
  }
  json.writeArrayEnd();
}

代码示例来源:origin: junkdog/artemis-odb

private void writeGroups(Json json, Entity e) {
  if (groupManager == null)
    return;
  ImmutableBag<String> groups = groupManager.getGroups(e);
  if (groups.size() == 0)
    return;
  json.writeArrayStart("groups");
  for (String group : groups) {
    json.writeValue(group);
  }
  json.writeArrayEnd();
}

代码示例来源:origin: SquidPony/SquidLib

@Override
public void write(Json json, Coord object, Class knownType) {
  if(object == null)
  {
    json.writeValue(null);
    return;
  }
  json.writeArrayStart();
  json.writeValue(object.x, int.class);
  json.writeValue(object.y, int.class);
  json.writeArrayEnd();
}

代码示例来源:origin: org.mini2Dx/mini2Dx-core

private <T> void writeSerializedCollection(Field field, SerializedCollection collection, Json json) throws SerializationException {
  if (field != null) {
    json.writeArrayStart(field.getName());
  } else {
    json.writeArrayStart();
  }
  
  int arrayLength = collection.getLength();
  for (int i = 0; i < arrayLength; i++) {
    writeObject(field, collection.get(i), null, json);
  }
  json.writeArrayEnd();
  collection.dispose();
}

代码示例来源:origin: junkdog/artemis-odb

@Override
public void write(Json json, IntBag entities, Class knownType) {
  recursionLevel++;
  if (recursionLevel == 1) {
    json.writeObjectStart();
    for (int i = 0, s = entities.size(); s > i; i++) {
      Entity e = world.getEntity(entities.get(i));
      json.writeValue(Integer.toString(e.getId()), e);
    }
    json.writeObjectEnd();
  } else {
    json.writeArrayStart();
    for (int i = 0, s = entities.size(); s > i; i++) {
      json.writeValue(entities.get(i));
    }
    json.writeArrayEnd();
  }
  recursionLevel--;
}

代码示例来源:origin: SquidPony/SquidLib

@Override
public void write(Json json, IntDoubleOrderedMap object, Class knownType) {
  if(object == null)
  {
    json.writeValue(null);
    return;
  }
  json.writeObjectStart();
  json.writeArrayStart("k");
  IntDoubleOrderedMap.KeyIterator ki = object.keySet().iterator();
  while (ki.hasNext())
    json.writeValue(ki.nextInt());
  json.writeArrayEnd();
  json.writeArrayStart("v");
  IntDoubleOrderedMap.DoubleIterator vi = object.values().iterator();
  while (vi.hasNext())
    json.writeValue(vi.nextDouble());
  json.writeArrayEnd();
  json.writeValue("f", object.f);
  json.writeObjectEnd();
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

ActionUtils.writeJson(a, json);
  json.writeArrayEnd();
} else {
  json.writeValue("ip", ip);
  json.writeArrayEnd();

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

ActionUtils.writeJson(a, json);
json.writeArrayEnd();
json.writeArrayEnd();

代码示例来源:origin: com.badlogicgames.gdx/gdx

for (int i = 0, n = array.size; i < n; i++)
  writeValue(array.get(i), elementType, null);
writeArrayEnd();
return;
for (int i = 0, n = queue.size; i < n; i++)
  writeValue(queue.get(i), elementType, null);
writeArrayEnd();
return;
  for (Object item : (Collection)value)
    writeValue(item, elementType, null);
  writeArrayEnd();
  writeObjectEnd();
} else {
  for (Object item : (Collection)value)
    writeValue(item, elementType, null);
  writeArrayEnd();
for (int i = 0; i < length; i++)
  writeValue(ArrayReflection.get(value, i), elementType, null);
writeArrayEnd();
return;

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

json.writeValue(npp.top);
json.writeValue(npp.bottom);
json.writeArrayEnd();
json.writeArrayStart("pads");
json.writeValue(npp.padLeft);
json.writeValue(npp.padTop);
json.writeValue(npp.padBottom);
json.writeArrayEnd();
json.writeObjectEnd();

相关文章