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


Java CoordinateConverter.area方法代码示例

本文整理汇总了Java中ethanjones.cubes.world.CoordinateConverter.area方法的典型用法代码示例。如果您正苦于以下问题:Java CoordinateConverter.area方法的具体用法?Java CoordinateConverter.area怎么用?Java CoordinateConverter.area使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ethanjones.cubes.world.CoordinateConverter的用法示例。


在下文中一共展示了CoordinateConverter.area方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tryPropagateRemove

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue,
		LightWorldSection w, int x, int y, int z, int l) {
	int dX = CoordinateConverter.area(x) - w.initialAreaX;
	int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
	Area a = w.areas[dX + 1][dZ + 1];
	int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
	if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
		return;
	int p = ((a.light[ref] >> 4) & 0xF);
	if (p != 0 && p < l) {
		a.light[ref] = (byte) (a.light[ref] & 0xF); // same as
													// ((a.light[ref] &
													// 0xF0) | (0 << 4))
		a.updateRender(y / SIZE_BLOCKS);
		a.modify();
		removeQueue.add(new LightNode(x, y, z, p));
	} else if (p >= l) {
		addQueue.add(new LightNode(x, y, z, p));
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:21,代码来源:SunLight.java

示例2: tryPropagateAdd

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z,
		int ln) {
	int dX = CoordinateConverter.area(x) - w.initialAreaX;
	int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
	Area a = w.areas[dX + 1][dZ + 1];
	int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
	if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
		return;
	int i = ((a.light[ref] >> 4) & 0xF);
	if (i + 1 <= ln) { // DIFFERENT + 1 instead of + 2
		a.light[ref] = (byte) ((a.light[ref] & 0xF) | (ln << 4));
		a.updateRender(y / SIZE_BLOCKS);
		a.modify();
		lightQueue.add(new LightNode(x, y, z, ln));
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:17,代码来源:SunLight.java

示例3: tryPropagateRemove

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue,
		LightWorldSection w, int x, int y, int z, int l) {
	int dX = CoordinateConverter.area(x) - w.initialAreaX;
	int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
	Area a = w.areas[dX + 1][dZ + 1];
	int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
	if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
		return;
	int p = a.light[ref] & 0xF;
	if (p != 0 && p < l) {
		a.light[ref] = (byte) (a.light[ref] & 0xF0); // same as
														// ((a.light[ref] &
														// 0xF0) | 0)
		a.updateRender(y / SIZE_BLOCKS);
		a.modify();
		removeQueue.add(new LightNode(x, y, z, p));
	} else if (p >= l) {
		addQueue.add(new LightNode(x, y, z, p));
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:21,代码来源:BlockLight.java

示例4: tryPropagateRemove

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue, LightWorldSection w, int x, int y, int z, int l) {
  int dX = CoordinateConverter.area(x) - w.initialAreaX;
  int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
  Area a = w.areas[dX + 1][dZ + 1];
  int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
  if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
  int p = ((a.light[ref] >> 4) & 0xF);
  if (p != 0 && p < l) {
    a.light[ref] = (byte) (a.light[ref] & 0xF); // same as ((a.light[ref] & 0xF0) | (0 << 4))
    a.updateRender(y / SIZE_BLOCKS);
    a.modify();
    removeQueue.add(new LightNode(x, y, z, p));
  } else if (p >= l) {
    addQueue.add(new LightNode(x, y, z, p));
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:17,代码来源:SunLight.java

示例5: tryPropagateRemove

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue, LightWorldSection w, int x, int y, int z, int l) {
  int dX = CoordinateConverter.area(x) - w.initialAreaX;
  int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
  Area a = w.areas[dX + 1][dZ + 1];
  int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
  if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
  int p = a.light[ref] & 0xF;
  if (p != 0 && p < l) {
    a.light[ref] = (byte) (a.light[ref] & 0xF0); // same as ((a.light[ref] & 0xF0) | 0)
    a.updateRender(y / SIZE_BLOCKS);
    a.modify();
    removeQueue.add(new LightNode(x, y, z, p));
  } else if (p >= l) {
    addQueue.add(new LightNode(x, y, z, p));
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:17,代码来源:BlockLight.java

示例6: tryPropagateAdd

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z,
		int l) {
	int dX = CoordinateConverter.area(x) - w.initialAreaX;
	int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
	Area a = w.areas[dX + 1][dZ + 1];
	int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
	if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
		return;
	if ((a.light[ref] & 0xF) + 2 <= l) {
		a.light[ref] = (byte) ((a.light[ref] & 0xF0) | (l - 1));
		a.updateRender(y / SIZE_BLOCKS);
		a.modify();
		lightQueue.add(new LightNode(x, y, z, l - 1));
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:16,代码来源:BlockLight.java

示例7: getEntitiesForSave

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public DataGroup[] getEntitiesForSave(int areaX, int areaZ) {
	lock.readLock();
	ArrayList<DataGroup> dataGroups = new ArrayList<DataGroup>();
	for (Entity entity : values()) {
		if (areaX == CoordinateConverter.area(entity.position.x)
				&& areaZ == CoordinateConverter.area(entity.position.z) && !(entity instanceof Player)) {
			dataGroups.add(entity.write());
		}
	}
	DataGroup[] array = dataGroups.size() == 0 ? new DataGroup[0]
			: dataGroups.toArray(new DataGroup[dataGroups.size()]);
	lock.readUnlock();
	return array;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:15,代码来源:Entities.java

示例8: tryPropagateAdd

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z, int ln) {
  int dX = CoordinateConverter.area(x) - w.initialAreaX;
  int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
  Area a = w.areas[dX + 1][dZ + 1];
  int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
  if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
  int i = ((a.light[ref] >> 4) & 0xF);
  if (i + 1 <= ln) { // DIFFERENT + 1 instead of + 2
    a.light[ref] = (byte) ((a.light[ref] & 0xF) | (ln << 4));
    a.updateRender(y / SIZE_BLOCKS);
    a.modify();
    lightQueue.add(new LightNode(x, y, z, ln));
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:15,代码来源:SunLight.java

示例9: tryPropagateAdd

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z, int l) {
  int dX = CoordinateConverter.area(x) - w.initialAreaX;
  int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
  Area a = w.areas[dX + 1][dZ + 1];
  int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
  if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
  if ((a.light[ref] & 0xF) + 2 <= l) {
    a.light[ref] = (byte) ((a.light[ref] & 0xF0) | (l - 1));
    a.updateRender(y / SIZE_BLOCKS);
    a.modify();
    lightQueue.add(new LightNode(x, y, z, l - 1));
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:14,代码来源:BlockLight.java

示例10: getEntitiesForSave

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public DataGroup[] getEntitiesForSave(int areaX, int areaZ) {
  lock.readLock();
  ArrayList<DataGroup> dataGroups = new ArrayList<DataGroup>();
  for (Entity entity : values()) {
    if (areaX == CoordinateConverter.area(entity.position.x) && areaZ == CoordinateConverter.area(entity.position.z) && !(entity instanceof Player)) {
      dataGroups.add(entity.write());
    }
  }
  DataGroup[] array = dataGroups.size() == 0 ? new DataGroup[0] : dataGroups.toArray(new DataGroup[dataGroups.size()]);
  lock.readUnlock();
  return array;
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:13,代码来源:Entities.java

示例11: setFromBlockCoordinates

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public AreaReference setFromBlockCoordinates(int blockX, int blockZ) {
	this.areaX = CoordinateConverter.area(blockX);
	this.areaZ = CoordinateConverter.area(blockZ);
	this.hashCode = 0;
	return this;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:7,代码来源:AreaReference.java

示例12: setFromBlockReference

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public AreaReference setFromBlockReference(BlockReference blockReference) {
	this.areaX = CoordinateConverter.area(blockReference.blockX);
	this.areaZ = CoordinateConverter.area(blockReference.blockZ);
	this.hashCode = 0;
	return this;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:7,代码来源:AreaReference.java

示例13: setFromPosition

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public AreaReference setFromPosition(float x, float z) {
	this.areaX = CoordinateConverter.area(CoordinateConverter.block(x));
	this.areaZ = CoordinateConverter.area(CoordinateConverter.block(z));
	this.hashCode = 0;
	return this;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:7,代码来源:AreaReference.java

示例14: contains

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public boolean contains(Vector3 position) {
	int areaX = CoordinateConverter.area(position.x);
	int areaZ = CoordinateConverter.area(position.z);
	return areaX >= minAreaX && areaX <= maxAreaX && areaZ >= minAreaZ && areaZ <= maxAreaZ;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:6,代码来源:WorldRegion.java

示例15: positionInLoadRange

import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public boolean positionInLoadRange(Vector3 position) {
	int areaX = CoordinateConverter.area(position.x);
	int areaZ = CoordinateConverter.area(position.z);
	return areaX >= (playerArea.areaX - loadDistance) && areaX <= (playerArea.areaX + loadDistance)
			&& areaZ >= (playerArea.areaZ - loadDistance) && areaZ <= (playerArea.areaZ + loadDistance);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:7,代码来源:PlayerManager.java


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