1 = ObjectList Class Reference =
4 _Italics_ means private (in the sense that they shouldn't be set manually).
7 `--------------`--------------------
9 ------------------------------------
10 _head_ head of the list
11 _tail_ tail of the list
12 _temp_ temporary data slot
13 _size_ the size of the list (read-only)
14 ------------------------------------
19 `--------------`--------------------
21 ------------------------------------
23 push_front(obj) adds an object to the front of the list
24 push_back(obj) adds an object to the back of the list
25 front() returns the element at the front of the list, else nil
26 back() returns the element at the back of the list, else nil
27 pop_front() removes the front element from the list
28 pop_back() removes the back element from the list
29 clear() clears the list
30 iterator() returns an iterator for use in a generic for loop
31 update(delta) updates all Object instances in the list
32 draw() draws all Object instances in the list
33 ------------------------------------
36 This class is designed with an interface similar to the STL::list class. While
37 it happens to be named _ObjectList_, it can be used to store any data type.
41 source~~~~~~~~~~~~~~~~~~~~~~~~~
42 list = ObjectList:new()
44 list:push_back("world")
45 list:push_front("hello")
52 for x in list:iterator() do
56 list:push_back(MyObj:new())
57 list:draw() --draws the previously instantiated object only
59 source~~~~~~~~~~~~~~~~~~~~~~~~~