本文整理汇总了C#中Hex.MeetsRestrictionRequirements方法的典型用法代码示例。如果您正苦于以下问题:C# Hex.MeetsRestrictionRequirements方法的具体用法?C# Hex.MeetsRestrictionRequirements怎么用?C# Hex.MeetsRestrictionRequirements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hex
的用法示例。
在下文中一共展示了Hex.MeetsRestrictionRequirements方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsValideMigrationTarget
public bool IsValideMigrationTarget(Hex hex)
{
bool verdict = false;
foreach(locomotionType loco in locomotion){
if(hex.MeetsLocomotionRequirements(loco)){
verdict = true;
break;
}
}
foreach(Adaptation.restriction item in restrictions){
if(!hex.MeetsRestrictionRequirements(item)){
verdict = false;
break;
}
}
return verdict;
}
示例2: PopulateRestrictionIcons
private void PopulateRestrictionIcons(Hex hab)
{
bool hasRestricts = false;
List<Adaptation.restriction> validRestricts = new List<Adaptation.restriction>();
List<Adaptation.restriction> liveRestricts = new List<Adaptation.restriction>();
for (int i = 0; i < restrictionIcons.Length; i++)
{
restrictionIcons[i].gameObject.SetActive(false);
}
foreach (Adaptation.restriction item in System.Enum.GetValues(typeof(Adaptation.restriction)))
{
if (!hab.MeetsRestrictionRequirements(item)) {
validRestricts.Add(item);
}
}
foreach (Adaptation.restriction item in validRestricts)
{
if (playerCritter.restrictions.Contains(item))
{
liveRestricts.Add(item);
}
}
for(int i = 0; i < liveRestricts.Count; i++)
{
restrictionIcons[i].gameObject.SetActive(true);
restrictionIcons[i].sprite = IconController.DetermineStatSprite(liveRestricts[i].ToString(), EvoDescriptionPanel.effectType.RESTRICT);
restrictionIcons[i].color = IconController.DetermineStatColor(liveRestricts[i].ToString(), EvoDescriptionPanel.effectType.RESTRICT);
}
if (liveRestricts.Count > 0) { hasRestricts = true; }
SetHeight(hasRestricts);
}