use of com.b3dgs.lionengine.game.Configurer in project lionengine by b3dgs.
the class ActionConfigTest method testExportsImports.
/**
* Test exports imports.
*/
@Test
void testExportsImports() {
final ActionConfig action = new ActionConfig("name", "description", 0, 1, 16, 32);
final Xml root = new Xml("test");
root.add(ActionConfig.exports(action));
final Media media = Medias.create("action.xml");
root.save(media);
assertEquals(action, ActionConfig.imports(new Xml(media)));
assertEquals(action, ActionConfig.imports(new Configurer(media)));
assertTrue(media.getFile().delete());
}
use of com.b3dgs.lionengine.game.Configurer in project lionengine by b3dgs.
the class ActionsConfigTest method testExportsImports.
/**
* Test exports imports.
*/
@Test
void testExportsImports() {
final ActionRef ref = new ActionRef("ref", false, new ArrayList<ActionRef>());
final ActionRef ref2 = new ActionRef("ref", false, Arrays.asList(ref));
final Collection<ActionRef> refs = Arrays.asList(new ActionRef("test", true, Arrays.asList(ref2)));
final Xml root = new Xml("test");
root.add(ActionsConfig.exports(refs));
final Media media = Medias.create("producer.xml");
root.save(media);
assertEquals(refs, ActionsConfig.imports(new Xml(media), null));
assertEquals(refs, ActionsConfig.imports(new Configurer(media), null));
assertTrue(media.getFile().delete());
}
use of com.b3dgs.lionengine.game.Configurer in project lionengine by b3dgs.
the class LayerableConfigTest method testExportsImports.
/**
* Test exports imports.
*/
@Test
void testExportsImports() {
final Xml root = new Xml("test");
final LayerableConfig config = new LayerableConfig(0, 1);
root.add(LayerableConfig.exports(config));
final Media media = Medias.create("Object.xml");
root.save(media);
assertEquals(config, LayerableConfig.imports(new Xml(media)));
assertEquals(config, LayerableConfig.imports(new Configurer(media)));
assertTrue(media.getFile().delete());
}
use of com.b3dgs.lionengine.game.Configurer in project lionengine by b3dgs.
the class ProducibleConfigTest method testExportsImports.
/**
* Test exports imports.
*/
@Test
void testExportsImports() {
final ProducibleConfig producible = new ProducibleConfig(1, 2, 3);
final Xml root = new Xml("test");
root.add(SizeConfig.exports(new SizeConfig(producible.getWidth(), producible.getHeight())));
root.add(ProducibleConfig.exports(producible));
final Media media = Medias.create("producible.xml");
root.save(media);
assertEquals(producible, ProducibleConfig.imports(new Xml(media)));
assertEquals(producible, ProducibleConfig.imports(new Setup(media)));
assertEquals(producible, ProducibleConfig.imports(new Configurer(media)));
assertTrue(media.getFile().delete());
}
use of com.b3dgs.lionengine.game.Configurer in project lionengine by b3dgs.
the class AttackerConfigTest method testExportsImports.
/**
* Test exports imports.
*/
@Test
void testExportsImports() {
final AttackerConfig config = new AttackerConfig(1, 2, 3, 4, 5);
final Xml root = new Xml("test");
root.add(AttackerConfig.exports(config));
final Media media = Medias.create("Object.xml");
root.save(media);
assertEquals(config, AttackerConfig.imports(new Xml(media)));
assertEquals(config, AttackerConfig.imports(new Configurer(media)));
assertTrue(media.getFile().delete());
}
Aggregations