• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EnumTolerance类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中forestry.api.genetics.EnumTolerance的典型用法代码示例。如果您正苦于以下问题:Java EnumTolerance类的具体用法?Java EnumTolerance怎么用?Java EnumTolerance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EnumTolerance类属于forestry.api.genetics包,在下文中一共展示了EnumTolerance类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSuitableBiomeIds

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
@Override
public ArrayList<Integer> getSuitableBiomeIds() {
	EnumTemperature temperature = genome.getPrimaryAsBee().getTemperature();
	EnumTolerance temperatureTolerance = genome.getToleranceTemp();

	ArrayList<EnumTemperature> toleratedTemperatures = ClimateHelper.getToleratedTemperature(temperature, temperatureTolerance);

	EnumHumidity humidity = genome.getPrimaryAsBee().getHumidity();
	EnumTolerance humidityTolerance = genome.getToleranceHumid();

	ArrayList<EnumHumidity> toleratedHumidities = ClimateHelper.getToleratedHumidity(humidity, humidityTolerance);

	ArrayList<Integer> biomeIdsTemp = new ArrayList<Integer>();
	for (EnumTemperature temp : toleratedTemperatures) {
		biomeIdsTemp.addAll(EnumTemperature.getBiomeIds(temp));
	}

	ArrayList<Integer> biomeIdsHumid = new ArrayList<Integer>();
	for (EnumHumidity humid : toleratedHumidities) {
		biomeIdsHumid.addAll(EnumHumidity.getBiomeIds(humid));
	}

	biomeIdsTemp.retainAll(biomeIdsHumid);

	return biomeIdsTemp;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:27,代码来源:Bee.java


示例2: drawToleranceInfo

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
private void drawToleranceInfo(EnumTolerance tolerance, int x, int textColor) {
	int length = tolerance.toString().length();
	String text = "(" + tolerance.toString().substring(length - 1) + ")";

	// Enable correct lighting.
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

	switch (tolerance) {
	case BOTH_1:
	case BOTH_2:
	case BOTH_3:
	case BOTH_4:
	case BOTH_5:
		drawBothSymbol(x, getLineY() - 1);
		drawLine(text, x + (int)(20*factor), textColor);
		break;
	case DOWN_1:
	case DOWN_2:
	case DOWN_3:
	case DOWN_4:
	case DOWN_5:
		drawDownSymbol(x, getLineY() - 1);
		drawLine(text, x + (int)(20*factor), textColor);
		break;
	case UP_1:
	case UP_2:
	case UP_3:
	case UP_4:
	case UP_5:
		drawUpSymbol(x, getLineY() - 1);
		drawLine(text, x + (int)(20*factor), textColor);
		break;
	default:
		drawNoneSymbol(x, getLineY() - 1);
		drawLine("(0)", x + (int)(20*factor), textColor);
		break;
	}
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:39,代码来源:GuiBeealyzer.java


示例3: canWorkInTemperature

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
public boolean canWorkInTemperature(EnumTemperature temp) {
	IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()];
	return AlleleManager.climateHelper
			.isWithinLimits(temp, EnumHumidity.NORMAL, temperature, tolerance.getValue(), EnumHumidity.NORMAL, EnumTolerance.NONE);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:6,代码来源:BeeSpecies.java


示例4: canWorkInHumidity

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
public boolean canWorkInHumidity(EnumHumidity humid) {
	IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()];
	return AlleleManager.climateHelper.isWithinLimits(EnumTemperature.NORMAL, humid, EnumTemperature.NORMAL, EnumTolerance.NONE, humidity,
			tolerance.getValue());
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:6,代码来源:BeeSpecies.java


示例5: getToleranceTemp

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
@Override
public EnumTolerance getToleranceTemp() {
	return ((AlleleTolerance) getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal())).getValue();
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:BeeGenome.java


示例6: getToleranceHumid

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
@Override
public EnumTolerance getToleranceHumid() {
	return ((AlleleTolerance) getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal())).getValue();
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:5,代码来源:BeeGenome.java


示例7: checkBiomeHazard

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
private boolean checkBiomeHazard(World world, EnumTemperature temperature, EnumHumidity humidity, int x, int y, int z) {

		EnumTemperature beeTemperature = genome.getPrimaryAsBee().getTemperature();
		EnumTolerance temperatureTolerance = genome.getToleranceTemp();

		ArrayList<EnumTemperature> toleratedTemperatures = ClimateHelper.getToleratedTemperature(beeTemperature, temperatureTolerance);
		boolean validTemp = false;

		validTemp = toleratedTemperatures.contains(temperature);

		if (!validTemp)
			return false;

		EnumHumidity beeHumidity = genome.getPrimaryAsBee().getHumidity();
		EnumTolerance humidityTolerance = genome.getToleranceHumid();

		ArrayList<EnumHumidity> toleratedHumidity = ClimateHelper.getToleratedHumidity(beeHumidity, humidityTolerance);

		boolean validHumidity = false;

		validHumidity = toleratedHumidity.contains(humidity);

		return validHumidity;
	}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:25,代码来源:Bee.java


示例8: checkBiomeHazard

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
private boolean checkBiomeHazard(IBeeGenome genome, float temperature, float humidity) {

		EnumTemperature beeTemperature = genome.getPrimaryAsBee().getTemperature();
		EnumTolerance temperatureTolerance = genome.getToleranceTemp();

		ArrayList<EnumTemperature> toleratedTemperatures = ClimateHelper.getToleratedTemperature(beeTemperature, temperatureTolerance);
		boolean validTemp = false;

		validTemp = toleratedTemperatures.contains(ClimateHelper.getTemperature(temperature));

		if (!validTemp)
			return false;

		EnumHumidity beeHumidity = genome.getPrimaryAsBee().getHumidity();
		EnumTolerance humidityTolerance = genome.getToleranceHumid();

		ArrayList<EnumHumidity> toleratedHumidity = ClimateHelper.getToleratedHumidity(beeHumidity, humidityTolerance);

		boolean validHumidity = false;

		validHumidity = toleratedHumidity.contains(ClimateHelper.getHumidity(humidity));

		return validHumidity;
	}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:25,代码来源:ComponentVillageBeeHouse.java


示例9: getToleratedHumidity

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
public static ArrayList<EnumHumidity> getToleratedHumidity(EnumHumidity prefered, EnumTolerance tolerance) {

		ArrayList<EnumHumidity> tolerated = new ArrayList<EnumHumidity>();
		tolerated.add(prefered);

		switch (tolerance) {

		case BOTH_5:
		case BOTH_4:
		case BOTH_3:
		case BOTH_2:
			if (prefered.ordinal() + 2 < EnumHumidity.values().length) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() + 2]);
			}
			if (prefered.ordinal() - 2 >= 0) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() - 2]);
			}
		case BOTH_1:
			if (prefered.ordinal() + 1 < EnumHumidity.values().length) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() + 1]);
			}
			if (prefered.ordinal() - 1 >= 0) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() - 1]);
			}
			return tolerated;

		case UP_5:
		case UP_4:
		case UP_3:
		case UP_2:
			if (prefered.ordinal() + 2 < EnumHumidity.values().length) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() + 2]);
			}
		case UP_1:
			if (prefered.ordinal() + 1 < EnumHumidity.values().length) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() + 1]);
			}
			return tolerated;

		case DOWN_5:
		case DOWN_4:
		case DOWN_3:
		case DOWN_2:
			if (prefered.ordinal() - 2 >= 0) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() - 2]);
			}
		case DOWN_1:
			if (prefered.ordinal() - 1 >= 0) {
				tolerated.add(EnumHumidity.values()[prefered.ordinal() - 1]);
			}
			return tolerated;

		default:
			return tolerated;
		}

	}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:58,代码来源:ClimateHelper.java


示例10: AlleleTolerance

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
public AlleleTolerance(String uid, EnumTolerance value) {
	this(uid, value, false);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:AlleleTolerance.java


示例11: getValue

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
public EnumTolerance getValue() {
	return value;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:4,代码来源:AlleleTolerance.java


示例12: getToleranceTemp

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
EnumTolerance getToleranceTemp(); 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:2,代码来源:IButterflyGenome.java


示例13: getToleranceHumid

import forestry.api.genetics.EnumTolerance; //导入依赖的package包/类
EnumTolerance getToleranceHumid(); 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:2,代码来源:IButterflyGenome.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BandAccelerometerEvent类代码示例发布时间:2022-05-22
下一篇:
Java XYEntry类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap