changeset 50:b155a875de42

Some API updates
author John@Yosemite-PC
date Wed, 21 Mar 2012 23:23:06 -0400
parents f52d472f0b0a
children 11f18e279229
files Lists.lua
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Lists.lua	Wed Mar 21 22:52:42 2012 -0400
+++ b/Lists.lua	Wed Mar 21 23:23:06 2012 -0400
@@ -116,6 +116,12 @@
     self.id = newId
     return temp
 end
+function ListEntry:GetClass() -- todo: consider if this is ok
+    return PersonList:Select(self.id):GetClass()
+end
+function ListEntry:GetName() -- todo: consider if this is ok
+    return PersonList:Select(self.id):GetName()
+end
 
 List = 
 {
@@ -243,6 +249,9 @@
     local listIndex = self:GetId()
     return InitiateChange("InsertEntry",self,{listIndex=listIndex,id=id,roll=index})
 end
+function List:GetLength()
+    return #self.data
+end
 function List:OrderedListEntryIter()
     local i = 0
     local n = #self.data
@@ -382,6 +391,7 @@
         end
     end
 end
+-- todo: iterator for lists ... it's pretty necessary
 
 Toon =
 {
@@ -523,7 +533,7 @@
     end
 end
 -- todo: remove reserve
-function PersonList:IsActive(id)
+function PersonList:IsActive(id) -- todo: support LE as input - saves IsActive(le:GetId())
     return self.active.raid[id] or self.active.reserve[id]
 end
 function PersonList:AddMissing()