DeenGames.Utils.Tower.Core.TowerScreen.ManageForGarbageCollection C# (CSharp) Method

ManageForGarbageCollection() public method

public ManageForGarbageCollection ( Object target ) : void
target Object
return void
        public void ManageForGarbageCollection(Object target)
        {
            if (target is Sprite) {
                this.mSprites.Add((Sprite)target);
            }
            else if (target is Text)
            {
                this.mTexts.Add((Text)target);
            }
            else if (target is AxisAlignedRectangle)
            {
                this.mAxisAlignedRectangles.Add((AxisAlignedRectangle)target);
            }
            else if (target is TowerText)
            {
                TowerText text = (TowerText)target;
                this.mTexts.Add(text.BaseText);
                this.mTexts.Add(text.EffectText);
            }
            else
            {
                throw new ArgumentException("Not sure how to manage " + target);
            }
        }