Mercurial > wow > breuesk
comparison Lists.lua @ 45:8d3187b12443
Start of sketch of a List object
author | John@Yosemite-PC |
---|---|
date | Thu, 15 Mar 2012 23:50:49 -0400 |
parents | 8913e7d79cad |
children | 6c0a8acccbc8 |
comparison
equal
deleted
inserted
replaced
44:8913e7d79cad | 45:8d3187b12443 |
---|---|
90 | 90 |
91 raidNameP = {} -- "name" is present in raid | 91 raidNameP = {} -- "name" is present in raid |
92 raidIdP = {} -- "id" is present in raid | 92 raidIdP = {} -- "id" is present in raid |
93 reserveIdP = {} -- "reserve id present" | 93 reserveIdP = {} -- "reserve id present" |
94 local personName2id = {} -- given "name" get that person's id | 94 local personName2id = {} -- given "name" get that person's id |
95 | |
96 List = | |
97 { | |
98 id = 0 | |
99 name = "" | |
100 Sort = function() | |
101 end | |
102 } | |
103 function List:new() -- TODO: take args, build list | |
104 n = {} | |
105 setmetatable(n,self) | |
106 self.__index = self | |
107 return n | |
108 end | |
109 function List:HasID(id) | |
110 for i = 1,#self do | |
111 if id == self[i].id then | |
112 return true | |
113 end | |
114 end | |
115 return false | |
116 end | |
117 function List:GetID() | |
118 return self.id | |
119 end | |
120 function List:RemoveEntry() | |
121 end | |
122 function List:InsertEntry() | |
123 end | |
124 function List:OrderedIter() | |
125 end | |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | |
95 | 136 |
96 | 137 |
97 function SelfDestruct() | 138 function SelfDestruct() |
98 lists = {} | 139 lists = {} |
99 persons = {} | 140 persons = {} |