local registeredClasses = {} namespace("sage.gear").StatsRegistrar = { setClass = function(self, className) self.class = className return self end, setColor = function(self, t) self.color = t return self end, stats = function(self, t) self.statsTable = t return self end, registerAs = function(self, name) if self.class and self.color and self.statsTable then registeredClasses[name] = {class=self.class, color=self.color, stats=self.statsTable} end self.class = nil end } namespace("sage.gear").AllStats = function(callback) for spec,data in pairs(registeredClasses) do callback(spec, data.class, data.stats, data.color) end end