コード例 #1
0
        // =====================================================================
        // Utility Functions
        // =====================================================================

        private static void PlaceResourceAt(FreeResourceType resourceType, Vector3 position)
        {
            // Refer to Player::DestroyPerson.
            FreeResource resource = FreeResourceManager.inst.GetPrefabFor(resourceType).CreateResource(position, -1);

            resource.Holder = null;
        }
コード例 #2
0
ファイル: Analytics.cs プロジェクト: DaDevFox/KCMods
        public static int GetProductionPowerForResourceInKingdom(FreeResourceType type)
        {
            int production = 0;

            for (int i = 0; i < World.inst.NumLandMasses; i++)
            {
                if (Player.inst.LandMassIsAPlayerLandMass(i))
                {
                    production += GetProductionPowerForResourceOnLandmass(type, i);
                }
            }
            return(production);
        }
コード例 #3
0
ファイル: Analytics.cs プロジェクト: DaDevFox/KCMods
        public static int GetProductionPowerForResourceOnLandmass(FreeResourceType type, int landmassIdx)
        {
            int production = 0;
            ArrayExt <Building> buildings = Player.inst.GetBuildingListForLandMass(landmassIdx);

            foreach (Building building in buildings.data)
            {
                if (building != null)
                {
                    if (building.Yield != null)
                    {
                        if (building.Yield.Get(type) > 0)
                        {
                            production += (int)(building.Yield.Get(type));
                        }
                    }
                }
            }


            return(production);
        }