Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        // 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);
        }
Exemplo n.º 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);
        }