use of org.asassecreations.engine.serializer.ADatabase in project Voxel_Game by ASasseCreations.
the class Inventory method save.
public void save() {
final ADatabase database = new ADatabase("inventory");
for (int i = 0; i < inventory.length; i++) {
if (inventory[i] == null)
continue;
final AObject object = new AObject("SLOT" + i);
object.addField(AField.Integer("id", inventory[i].item.id));
object.addField(AField.Integer("amount", inventory[i].amount));
database.addObject(object);
}
database.serializeToFile(Content.WORLD_FOLDER + "inventory.dat");
}
Aggregations