示例#1
0
    public void Upgrade()
    {
        EFeatureType upgradedFeature = EFeatureType.None;

        switch (featureType)
        {
        case EFeatureType.Village:
            upgradedFeature = EFeatureType.Town;
            break;

        case EFeatureType.Town:
            upgradedFeature = EFeatureType.City;
            break;
        }

        if (upgradedFeature != EFeatureType.None)
        {
            FeatureCosts selectedFeatureCost = homeRegion.FeatureCosts[upgradedFeature.ToString()];

            if (selectedFeatureCost.VerifyCosts(homeRegion))
            {
                FeatureType = upgradedFeature;
                BuildFeature();
            }
            else
            {
                StartCoroutine(controller.FlashCursor());
            }
        }
    }
示例#2
0
    public void SetUpFeature(MapRegions home, EFeatureType type, GameController controller)
    {
        Start();
        homeRegion      = home;
        FeatureType     = type;
        this.controller = controller;

        BuildFeature();
    }
示例#3
0
    public virtual EFeatureType get_feature_type()
    {
        EFeatureType ret = (EFeatureType)modshogunPINVOKE.Preprocessor_get_feature_type(swigCPtr);

        if (modshogunPINVOKE.SWIGPendingException.Pending)
        {
            throw modshogunPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
示例#4
0
        public FeatureFactory AsType(EFeatureType featureType, int featureSubType)
        {
            _feature.TypeInfo = new TypeInfo()
            {
                ApiType = EApiType.Feature,
                Type    = (int)featureType,
                SubType = featureSubType
            };

            return(this);
        }
示例#5
0
    public void FeatureDropdownChanged(int currentIndex)
    {
        Vector2 cursorOffset = new Vector2(250, 250);

        DisableAllResourceRegionRenderers();

        if (currentIndex == 0 || currentIndex == 9 || currentIndex == 10)
        {
            foreach (GameObject g in features)
            {
                g.GetComponent <BoxCollider>().enabled = true;
            }

            if (currentIndex == 0)
            {
                currentCursorTexture    = null;
                currentFeatureSelection = EFeatureType.None;
                cursorOffset            = new Vector2(0, 0);
            }
            else if (currentIndex == 9)
            {
                currentCursorTexture    = cursorContainer.TradeRouteIcon;
                currentFeatureSelection = EFeatureType.TradeRoute;
            }
            else if (currentIndex == 10)
            {
                currentCursorTexture    = cursorContainer.AqeductIcon;
                currentFeatureSelection = EFeatureType.Aqueduct;
            }
        }
        else
        {
            foreach (GameObject g in features)
            {
                g.GetComponent <BoxCollider>().enabled = false;
            }

            if (currentIndex == 1)
            {
                currentCursorTexture    = cursorContainer.QuarryIcon;
                currentFeatureSelection = EFeatureType.Quarry;
                resourceRegions["MineAndQuarry"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["MineAndQuarry"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
            else if (currentIndex == 2)
            {
                currentCursorTexture    = cursorContainer.LumberMillIcon;
                currentFeatureSelection = EFeatureType.LumberMill;
                resourceRegions["LumberMill"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["LumberMill"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
            else if (currentIndex == 3)
            {
                currentCursorTexture    = cursorContainer.MineIcon;
                currentFeatureSelection = EFeatureType.Mine;
                resourceRegions["MineAndQuarry"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["MineAndQuarry"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
            else if (currentIndex == 4)
            {
                currentCursorTexture    = cursorContainer.FieldIcon;
                currentFeatureSelection = EFeatureType.Field;
                resourceRegions["LivestockFarmAndField"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["LivestockFarmAndField"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
            else if (currentIndex == 5)
            {
                currentCursorTexture    = cursorContainer.LivestockFarmIcon;
                currentFeatureSelection = EFeatureType.LivestockFarm;
                resourceRegions["LivestockFarmAndField"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["LivestockFarmAndField"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
            else if (currentIndex == 6)
            {
                currentCursorTexture    = cursorContainer.WellIcon;
                currentFeatureSelection = EFeatureType.Well;
                resourceRegions["Well"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["Well"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
            else if (currentIndex == 7)
            {
                currentCursorTexture    = cursorContainer.VillageIcon;
                currentFeatureSelection = EFeatureType.Village;
            }
            else if (currentIndex == 8)
            {
                currentCursorTexture    = cursorContainer.PortIcon;
                currentFeatureSelection = EFeatureType.Port;
                resourceRegions["Port"].gameObject.GetComponent <MeshRenderer>().enabled        = true;
                resourceRegions["Port"].gameObject.GetComponent <MeshRenderer>().material.color = new Color(1, 0, 0, 0.25f);
            }
        }

        Cursor.SetCursor(currentCursorTexture, cursorOffset, CursorMode.Auto);
    }