Entitas  0.40.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
EntitasCache.cs
1 using System.Collections.Generic;
2 
3 namespace Entitas {
4 
5  public static class EntitasCache {
6 
7  static readonly ObjectCache _cache = new ObjectCache();
8 
9  public static List<IComponent> GetIComponentList() { return _cache.Get<List<IComponent>>(); }
10  public static void PushIComponentList(List<IComponent> list) { list.Clear(); _cache.Push(list); }
11 
12  public static List<int> GetIntList() { return _cache.Get<List<int>>(); }
13  public static void PushIntList(List<int> list) { list.Clear(); _cache.Push(list); }
14 
15  public static HashSet<int> GetIntHashSet() { return _cache.Get<HashSet<int>>(); }
16  public static void PushIntHashSet(HashSet<int> hashSet) { hashSet.Clear(); _cache.Push(hashSet); }
17 
18  public static void Reset() {
19  _cache.Reset();
20  }
21  }
22 }