using System.Collections.Generic; namespace FluidHTN.Factory { public sealed class DefaultFactory : IFactory { public T[] CreateArray(int length) { return new T[length]; } public List CreateList() { return new List(); } public Queue CreateQueue() { return new Queue(); } public bool FreeArray(ref T[] array) { array = null; return array == null; } public bool FreeList(ref List list) { list = null; return list == null; } public bool FreeQueue(ref Queue queue) { queue = null; return queue == null; } public T Create() where T : new() { return new T(); } public bool Free(ref T obj) { obj = default(T); return obj == null; } } }