當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。