當前位置: 首頁>>代碼示例>>Java>>正文


Java TypeListManager類代碼示例

本文整理匯總了Java中net.openrs.cache.type.TypeListManager的典型用法代碼示例。如果您正苦於以下問題:Java TypeListManager類的具體用法?Java TypeListManager怎麽用?Java TypeListManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TypeListManager類屬於net.openrs.cache.type包,在下文中一共展示了TypeListManager類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import net.openrs.cache.type.TypeListManager; //導入依賴的package包/類
/**
 * @param args
 */
public static void main(String[] args) {
	try (Cache cache = new Cache(FileStore.open(Constants.CACHE_PATH))) {
		TypeListManager.initialize(cache);
		TypeListManager.print();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
開發者ID:jordanabrahambaws,項目名稱:Quavo,代碼行數:12,代碼來源:TypeDumper.java

示例2: initialize

import net.openrs.cache.type.TypeListManager; //導入依賴的package包/類
private void initialize(final Cache cache) throws IOException {
	TypeListManager.initialize(cache);
	Textures.initialize(cache);
	Sprites.initialize(cache);
	XTEAManager.touch();

	for (int i = 0; i < MAX_REGION; i++) {
		final Region region = new Region(i);

		int map = cache.getFileId(5, region.getTerrainIdentifier());
		int loc = cache.getFileId(5, region.getLocationsIdentifier());
		if (map == -1 && loc == -1)
			continue;

		if (map != -1) {
			region.loadTerrain(cache.read(5, map).getData());
		}

		if (loc != -1) {
			try {
				region.loadLocations(cache.read(5, loc, XTEAManager.lookupMap(i)).getData());
			}

			catch (Exception e) {
				flags.add(i);
			}
		}

		regions.add(region);

		if (lowestX == null || region.getBaseX() < lowestX.getBaseX()) {
			lowestX = region;
		}

		if (highestX == null || region.getBaseX() > highestX.getBaseX()) {
			highestX = region;
		}

		if (lowestY == null || region.getBaseY() < lowestY.getBaseY()) {
			lowestY = region;
		}

		if (highestY == null || region.getBaseY() > highestY.getBaseY()) {
			highestY = region;
		}

	}

	final Sprite mapscene = Sprites.getSprite("mapscene");
	final Sprite mapfunction = Sprites.getSprite("mapfunction");

	for (int i = 0; i < mapscene.size(); i++) {
		mapIcons.put(i, mapscene.getFrame(i).getScaledInstance(5, 6, 0));
	}

	for (int i = 0; i < mapfunction.size(); i++) {
		mapFunctions.put(i, mapfunction.getFrame(i));
	}
}
 
開發者ID:jordanabrahambaws,項目名稱:Quavo,代碼行數:60,代碼來源:MapImageDumper.java

示例3: initialize

import net.openrs.cache.type.TypeListManager; //導入依賴的package包/類
private void initialize(final Cache cache) throws IOException
{
	TypeListManager.initialize(cache);
	Textures.initialize(cache);
	Sprites.initialize(cache);
	XTEAManager.touch();
	
	for (int i = 0; i < MAX_REGION; i++)
	{
		final Region region = new Region(i);
		
		int map = cache.getFileId(5, region.getTerrainIdentifier());
		int loc = cache.getFileId(5, region.getLocationsIdentifier());
		if (map == -1 && loc == -1)
			continue;
		
		if (map != -1)
		{
			region.loadTerrain(cache.read(5, map).getData());
		}
		
		if (loc != -1)
		{
			ByteBuffer buffer = cache.getStore().read(5, loc);
			try
			{
				region.loadLocations(Container.decode(buffer, XTEAManager.lookupMap(i)).getData());
			}
			
			catch (Exception e)
			{
				if (buffer.limit() != 32)
				{
					flags.add(i);
				}
			}
		}
		
		regions.add(region);

		if (lowestX == null || region.getBaseX() < lowestX.getBaseX())
		{
			lowestX = region;
		}

		if (highestX == null || region.getBaseX() > highestX.getBaseX())
		{
			highestX = region;
		}

		if (lowestY == null || region.getBaseY() < lowestY.getBaseY())
		{
			lowestY = region;
		}

		if (highestY == null || region.getBaseY() > highestY.getBaseY())
		{
			highestY = region;
		}
		
	}
	
	final Sprite mapscene = Sprites.getSprite("mapscene");
	
	for (int i = 0; i < mapscene.size(); i++)
	{
		mapIcons.put(i, mapscene.getFrame(i).getScaledInstance(4, 5, 0));
	}
}
 
開發者ID:kfricilone,項目名稱:OpenRS,代碼行數:70,代碼來源:MapImageDumper.java


注:本文中的net.openrs.cache.type.TypeListManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。