本文整理汇总了Java中com.b3dgs.lionengine.game.feature.tile.map.persister.MapTilePersister类的典型用法代码示例。如果您正苦于以下问题:Java MapTilePersister类的具体用法?Java MapTilePersister怎么用?Java MapTilePersister使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapTilePersister类属于com.b3dgs.lionengine.game.feature.tile.map.persister包,在下文中一共展示了MapTilePersister类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMaps
import com.b3dgs.lionengine.game.feature.tile.map.persister.MapTilePersister; //导入依赖的package包/类
/**
* Get a list of maps.
*
* @param theme The theme name.
* @param count The file level count.
* @return List of maps.
*/
private static List<MapTile> getMaps(String theme, int count)
{
final List<MapTile> maps = new ArrayList<MapTile>();
for (int i = 0; i <= count; i++)
{
final Media level = Medias.create(Constant.FOLDER_LEVELS, theme, i + ".map");
final Services services = new Services();
final MapTile map = services.create(MapTileGame.class);
final MapTilePersister persister = map.addFeatureAndGet(new MapTilePersisterModel(services));
try
{
final FileReading reading = new FileReading(level);
persister.load(reading);
reading.close();
}
catch (final IOException exception)
{
Verbose.exception(exception);
}
maps.add(map);
}
return maps;
}
示例2: loading
import com.b3dgs.lionengine.game.feature.tile.map.persister.MapTilePersister; //导入依赖的package包/类
@Override
protected void loading(FileReading file) throws IOException
{
map.getFeature(MapTilePersister.class).load(file);
map.getFeature(MapTileGroup.class).loadGroups(Medias.create(map.getMedia().getParentPath(), "groups.xml"));
final Media pathfinding = Medias.create(map.getMedia().getParentPath(), "pathfinding.xml");
map.getFeature(MapTilePath.class).loadPathfinding(pathfinding);
minimap.load();
minimap.automaticColor();
minimap.prepare();
minimap.setLocation(MINIMAP_X, MINIMAP_Y);
camera.setLimits(map);
cursor.addImage(0, Medias.create("cursor.png"));
cursor.addImage(1, Medias.create("cursor_order.png"));
cursor.load();
cursor.setGrid(map.getTileWidth(), map.getTileHeight());
cursor.setInputDevice(pointer);
cursor.setViewer(camera);
final int baseX = 10;
final int baseY = 10;
createBase(baseX, baseY);
}
示例3: saving
import com.b3dgs.lionengine.game.feature.tile.map.persister.MapTilePersister; //导入依赖的package包/类
@Override
protected void saving(FileWriting file) throws IOException
{
map.getFeature(MapTilePersister.class).save(file);
}
示例4: loading
import com.b3dgs.lionengine.game.feature.tile.map.persister.MapTilePersister; //导入依赖的package包/类
@Override
protected void loading(FileReading file) throws IOException
{
map.getFeature(MapTilePersister.class).load(file);
}