-
Notifications
You must be signed in to change notification settings - Fork 113
Kryo Serialization
Daan van Yperen edited this page Sep 24, 2016
·
8 revisions
This module provides serialization to binary format using Kryo.
- Add
artemis-odb-serializer-kryo
module as dependency to your gradle/maven configuration. - Add the required manager and configure the kryo backend:
final WorldSerializationManager manager = WorldSerializationManager();
World world = new World(new WorldConfiguration().setSystem(manager));
manager.setSerializer(new KryoArtemisSerializer(world))
final InputStream is = AnyClass.class.getResourceAsStream("level.bin");
manager.load(is, SaveFileFormat.class);
final FileOutputStream fos = new FileOutputStream("level.json");
manager.save(fos, new SaveFileFormat(entities));
entities
is an IntBag with entity IDs defining the scope of the save operation.
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference