Φ wowmods - MagicLib-1.0 @ ?
[ addon updates | search | RSS | Google: subscribed link (?); Gadget | Twitter ]
[ login | register ] [ contact ]
search addons:

 • details
addon: MagicLib-1.0
listed author: Lonny   [list all addons]
latest version: 1.0.1
date last updated: Wed, 17 Feb 2010 08:59:14 +0000
date added: Tue, 16 Feb 2010 14:50:07 +0000
 
wowinterface.com: http://www.wowinterface.com/downloads/info15987-1.0.1.html

 • about + changelog
Change Log:






1.0.1 (17-02-10)






+ Fixed the 'ToColorString(...)' function to return the correct results.

+ Fixed a bug that made custom events shared across all addons.



Description:






A simple library that provides a common interface and functionality for addons.



This is a very lightweight library.



Usage

local magic = LibStub("MagicLib-1.0"):New("name")



local module = magic:NewModule("moduleName")



You can use your own table, as follow.



local myTable = { }

local magic = LibStub("MagicLib-1.0"):New("name", myTable)



local module = myTable:NewModule("moduleName")



Modules Interface

NewModule(name) - Create a new module.



Arguments.

name - (string) The name of the module.

inherit - (string, table) A module name, or an actual module for this module to derive from.

config - (table) A configuration table we may want to associate to this module.



Returns.

module - (table) A module.

config - (table) The configuration table the module is associated with.



GetModule(name) - Gets the given module.



Arguments.

name - (string) The name of the module.



Returns.

module - (table) A module.

config - (table) The configuration table the module is associated with.



NewInstance(name, ...) - Create an instance of a module.



Arguments.

name - (string) The name of the module.

args - (table) The constructor args you may need to pass.



Returns.

instance - (table) An instance of the given module.

config - (table) The configuration table the module is associated with.



Usage.

local magic = LibStub("MagicLib-1.0"):New("name")



-- Defines a type, essentially a class.

local t = magic:NewModule("typeName")



function t:ctor(param1, ...)

end



-- Creates an instance of the class.

local objName = magic:NewInstance("typeName", arg1, ...)



IterateModules() - Traverse through all modules.



Modules Functionality

GetName() - Gets the name of the module.



Returns.

name - (string) The name of the module.



GetOwner() - Gets the module's owner name....

 
Hint: see addon details for related searches in Google: use the Google Subscribed Links service.