diff --git a/CookieMonster.js b/CookieMonster.js index 8dc4b66..c711f28 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -31,6 +31,19 @@ if (typeof CM == "undefined") { * Cache * *********/ +/******** + * Section: General Cache related functions */ + +/** + * This functions runs all cache-functions to generate all "full" cache + * The declaration follows the structure of the CM.Cache.js file + * It is called by CM.DelayInit + * TODO: Add all functions that should be here and remove them from CM.Loop() + */ +CM.Cache.InitCache = function() { + CM.Cache.CacheDragonAuras(); +} + /******** * Section: Functions related to Dragon Auras */ @@ -47,6 +60,10 @@ CM.Cache.CacheDragonAuras = function() { /******** * Section: Functions related to Wrinklers */ +/** + * This functions caches data related to Wrinklers + * It is called by CM.Loop() + */ CM.Cache.RemakeWrinkBank = function() { CM.Cache.WrinkBankTotal = 0; CM.Cache.WrinkBankNormal = 0; @@ -4000,6 +4017,7 @@ CM.Init = function() { CM.DelayInit = function() { CM.Sim.InitData(); + CM.Cache.InitCache(); CM.Disp.CreateCssArea(); CM.Disp.CreateBotBar(); CM.Disp.CreateTimerBar(); @@ -4469,9 +4487,6 @@ CM.Sim.InitData = function() { for (var i in Game.Achievements) { CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i); } - - // Auras - CM.Cache.CacheDragonAuras(); } CM.Sim.CopyData = function() { diff --git a/src/Cache.js b/src/Cache.js index ff95705..c575948 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -2,6 +2,19 @@ * Cache * *********/ +/******** + * Section: General Cache related functions */ + +/** + * This functions runs all cache-functions to generate all "full" cache + * The declaration follows the structure of the CM.Cache.js file + * It is called by CM.DelayInit + * TODO: Add all functions that should be here and remove them from CM.Loop() + */ +CM.Cache.InitCache = function() { + CM.Cache.CacheDragonAuras(); +} + /******** * Section: Functions related to Dragon Auras */ @@ -18,6 +31,10 @@ CM.Cache.CacheDragonAuras = function() { /******** * Section: Functions related to Wrinklers */ +/** + * This functions caches data related to Wrinklers + * It is called by CM.Loop() + */ CM.Cache.RemakeWrinkBank = function() { CM.Cache.WrinkBankTotal = 0; CM.Cache.WrinkBankNormal = 0; diff --git a/src/Main.js b/src/Main.js index 12c0de1..80d16ea 100644 --- a/src/Main.js +++ b/src/Main.js @@ -229,6 +229,7 @@ CM.Init = function() { CM.DelayInit = function() { CM.Sim.InitData(); + CM.Cache.InitCache(); CM.Disp.CreateCssArea(); CM.Disp.CreateBotBar(); CM.Disp.CreateTimerBar(); diff --git a/src/Sim.js b/src/Sim.js index 7b3dd29..d4fc227 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -207,9 +207,6 @@ CM.Sim.InitData = function() { for (var i in Game.Achievements) { CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i); } - - // Auras - CM.Cache.CacheDragonAuras(); } CM.Sim.CopyData = function() {