示例#1
0
    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
0
    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);
    }