本文整理汇总了C#中Hex.GetTotalLocalPopulation方法的典型用法代码示例。如果您正苦于以下问题:C# Hex.GetTotalLocalPopulation方法的具体用法?C# Hex.GetTotalLocalPopulation怎么用?C# Hex.GetTotalLocalPopulation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hex
的用法示例。
在下文中一共展示了Hex.GetTotalLocalPopulation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateBitesize
private float CalculateBitesize(Hex Habitat)
{
float required = (Habitat.GetTotalLocalPopulation() * .12f * baseFoodValue);
return required;
}
示例2: RankPrey
//Ranks Prey based on local creatures stats and population to find the best targets
public void RankPrey(Hex hex)
{
float deviation;
float huntScore = 0;
float popCut;
float popScore;
float tastiness = 0;
float availPop = hex.GetTotalLocalPopulation() - GetLocalPopulation(hex);
float totalCritters = hex.localCritters.Count;
float critterCut = 100 / (totalCritters - 1);
Critter spot;
if(HuntScoreList.Capacity != totalCritters){
HuntScoreList.Clear();
}
HuntScoreList.TrimExcess();
for(int n = 0; n < totalCritters; n++){
spot = hex.localCritters[n];
if(spot != this){
popScore = 0;
huntScore = HuntScore(spot);
float sneakiness = 100f - spot.SneakScore(this);
popCut = (100 * spot.GetLocalPopulation(hex) / availPop);
tastiness = (huntScore - sneakiness);
deviation = popCut - critterCut;
if(deviation >= 0){
popScore = 100 * (Mathf.Pow(deviation, 1.5f));
popScore = (Mathf.Round(popScore)) / 100;
}
else if(deviation < 0){
popScore = 0;
}
tastiness = (Mathf.Pow(tastiness / 10, 2f) + popScore);
if(isPlayer){
//print(spot.name + "'s huntscore = " + huntScore + " vs tastiness = " + tastiness + "\r\n");
}
huntScore = ((tastiness) / 2) * 10 * AptitudeCheck(spot);
dietType[] diet = spot.GetDiet();
for(int i = 0; i < diet.Length; i++){
if(diet[i] == dietType.CARNO || diet[i] == dietType.SCAV){
huntScore = huntScore * .5f;
break;
}
}
huntScore = (Mathf.Round(10 * huntScore));
HuntScoreList.Add(huntScore);
} else{
huntScore = 0;
HuntScoreList.Add(0);
}
}
HuntScoreList.TrimExcess();
HuntChanceList.TrimExcess();
}