WaveFrogger.Services.EntityPoolComponent.FreeTerrain C# (CSharp) Method

FreeTerrain() public method

public FreeTerrain ( IEnumerable collection ) : void
collection IEnumerable
return void
        public void FreeTerrain(IEnumerable<Entity> collection)
        {
            foreach (var entity in collection)
            {
                this.FreeTreeEntity(entity.FindAllChildrenByTag(Constants.TAG_OBSTACLES));
                this.FreeTreeLimitEntity(entity.FindAllChildrenByTag(Constants.TAG_LIMITS));
                this.FreeCarEntity(entity.FindAllChildrenByTag(Constants.TAG_VEHICLE));

                this.EntityManager.Detach(entity);
                this.terrainPool[entity.Tag].Enqueue(entity);
            }
        }