5 #ifndef _OLDCOLLECTION_H_
6 #define _OLDCOLLECTION_H_
24 UnitListNode(
Unit *unit );
26 void PostInsert(
Unit *un );
29 UnitListNode(
Unit *unit, UnitListNode *
next );
32 private: UnitListNode();
33 UnitListNode(
const UnitListNode& );
34 UnitListNode& operator=(
const UnitListNode& );
42 u =
new UnitListNode( NULL );
43 u->next =
new UnitListNode( NULL,
new UnitListNode( NULL ) );
65 void GetNextValidUnit();
85 return pos->next->unit == NULL;
89 return pos->next->unit != NULL;
97 pos->next =
new UnitListNode( unit, pos->next );
104 return pos->next->unit;
136 const UnitListNode *pos;
137 void GetNextValidUnit();
160 return pos->next->unit;
195 const UnitListNode *pos;
205 return pos->next->unit;
233 return pos->next->unit == NULL;
237 return pos->next->unit != NULL;
254 pos->next =
new UnitListNode( unit, pos->next );
267 return pos->next->unit;
295 return pos->next->unit == NULL;
299 return pos->next->unit != NULL;
312 return u->next->unit == NULL;
332 for (UnitListNode *
i = u->next;
i != NULL;
i =
i->next)
333 if (
i->unit == un)
return;
338 u->next =
new UnitListNode( unit, u->next );
342 unitlistnode->next = u->next;
343 u->next = unitlistnode;
354 bool remove(
const Unit *unit );