Beispiel #1
0
        // Tries to return an instance of the Building class from the VillageObjectPool.
        // Used by ReadBuildingArray.
        internal static Building GetInstance(Village village)
        {
            var obj = (VillageObject)null;

            if (!VillageObjectPool.TryPop(Kind, out obj))
            {
                obj = new Building();
            }

            obj.SetVillageInternal(village);
            return((Building)obj);
        }
Beispiel #2
0
        internal static Decoration GetInstance(Village village)
        {
            var obj = (VillageObject)null;

            if (!VillageObjectPool.TryPop(Kind, out obj))
            {
                obj = new Decoration();
            }

            obj.SetVillageInternal(village);
            return((Decoration)obj);
        }
        // Tries to return an instance of the Building class from the VillageObjectPool.
        internal static Trap GetInstance(Village village)
        {
            var obj = (VillageObject)null;

            if (!VillageObjectPool.TryPop(Kind, out obj))
            {
                obj = new Trap();
            }

            obj.SetVillageInternal(village);
            return((Trap)obj);
        }
Beispiel #4
0
        internal static Obstacle GetInstance(Village village)
        {
            var obj = (VillageObject)null;

            if (!VillageObjectPool.TryPop(Kind, out obj))
            {
                obj = new Obstacle();
            }

            obj.SetVillageInternal(village);
            return((Obstacle)obj);
        }