Caching - SmArtKar/AthenaFramework GitHub Wiki

Since 1.4 update, Athena uses a caching system to improve its performance and flexibility. If you want to "link" any interface object to an object of your choice, you'll need to add your object with an interface to the corresponding cache via AddCache and RemoveCache methods with ID being your thing's ID. Remove must be called whenever the interface object is destroyed to prevent errors from appearing.

    public static class AthenaCache
    {
        public static Dictionary<int, List<IRenderable>> renderCache;
        public static Dictionary<int, List<IBodyModifier>> bodyCache;
        public static Dictionary<int, List<IArmored>> armorCache;
        public static Dictionary<int, List<IDamageResponse>> responderCache;
        public static Dictionary<int, List<IDamageModifier>> damageCache; 
        public static Dictionary<int, List<IStatModifier>> statmodCache;
        public static Dictionary<int, List<IProjectile>> projectileCache;
        public static Dictionary<int, List<IPreventEquip>> equipCache;

        public static void AddCache<T>(T elem, Dictionary<int, List<T>> cacheList, int id) { }

        public static void RemoveCache<T>(T elem, Dictionary<int, List<T>> cacheList, int id) { }
    }
⚠️ **GitHub.com Fallback** ⚠️