本文整理匯總了Java中net.openrs.cache.type.TypeListManager.initialize方法的典型用法代碼示例。如果您正苦於以下問題:Java TypeListManager.initialize方法的具體用法?Java TypeListManager.initialize怎麽用?Java TypeListManager.initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.openrs.cache.type.TypeListManager
的用法示例。
在下文中一共展示了TypeListManager.initialize方法的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();
}
}
示例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));
}
}
示例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));
}
}