当前位置: 首页>>代码示例>>Java>>正文


Java MapTilePersister类代码示例

本文整理汇总了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;
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:31,代码来源:Map.java

示例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);
}
 
开发者ID:b3dgs,项目名称:warcraft-remake,代码行数:27,代码来源:World.java

示例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);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:6,代码来源:World.java

示例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);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:6,代码来源:World.java


注:本文中的com.b3dgs.lionengine.game.feature.tile.map.persister.MapTilePersister类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。