view DependencyLoader/class.lua @ 15:a46bf694050c

cleaned up Tree's methods a bit and improved documentation Addon:Exists will now return false for Blizzard addons (needs to be handled better) Addon.lua will now use the raw hooks from the interface module fixed the inverted returns from IsForceLoadAvailable EnableAddOn and LoadAddOn hooks will now skip the extra processing if the addon does not exist or is a Blizzard addon moved the EnableAddOn queing to the interface
author mckenziemc
date Sat, 11 Dec 2010 01:48:39 -0800
parents 5362e308c3eb
children e7995d599184
line wrap: on
line source
--	class.lua
--	Implements a generic class builder.


local addonName, addonTable = ...

--	FIXME: prevent duplicate class definitions

print( string.format([[running %s\class.lua]], addonName) )

addonTable.classes = {}

function addonTable:NewClass(name)
	local class, prototype, metatable = {}, {}, {}
	
	class.prototype = prototype
	
	metatable.__index = prototype
	class.instanceMetatable = metatable
	
	self.classes[name] = class
	
	return class, prototype
end