本文整理汇总了C#中Hex.GetFoodHealth方法的典型用法代码示例。如果您正苦于以下问题:C# Hex.GetFoodHealth方法的具体用法?C# Hex.GetFoodHealth怎么用?C# Hex.GetFoodHealth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hex
的用法示例。
在下文中一共展示了Hex.GetFoodHealth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PickBestFood
private dietType PickBestFood(Hex hab)
{
float foodVal = 0;
dietType bestDiet = diet[0];
if (diet.Count > 1)
{
for (int i = 0; i < diet.Count; i++)
{
dietType testDiet = diet[i];
float food = hab.GetFoodHealth(testDiet);
if (food > foodVal)
{
foodVal = food;
bestDiet = testDiet;
}
}
}
return bestDiet;
}
示例2: GetTelegraphFoodScore
public float GetTelegraphFoodScore(Hex habitat)
{
float score = 0;
foreach (specialEffect item in leads)
{
float compareScore = 0;
if (item == specialEffect.CARNO) { compareScore = habitat.GetFoodHealth(Critter.dietType.CARNO); }
if (item == specialEffect.HERB) { compareScore = habitat.GetFoodHealth(Critter.dietType.HERB); }
if (item == specialEffect.FISH) { compareScore = habitat.GetFoodHealth(Critter.dietType.FISH); }
if (item == specialEffect.INSECT) { compareScore = habitat.GetFoodHealth(Critter.dietType.INSECT); }
if (item == specialEffect.SCAVANGER) { compareScore = habitat.GetFoodHealth(Critter.dietType.SCAV); }
if (compareScore > score)
{
score = compareScore;
}
}
return score;
}
示例3: GetWeakestDiet
public dietType GetWeakestDiet(Hex hab)
{
dietType testdiet = diet[0];
float val = 0;
float lowest = 1;
foreach (dietType item in diet)
{
val = hab.GetFoodHealth(item);
if (val < lowest)
{
testdiet = item;
lowest = val;
}
}
return testdiet;
}