mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
add itterators and make -free actually free the Array object
This commit is contained in:
parent
3a1c35faab
commit
673f6ba643
2 changed files with 17 additions and 0 deletions
|
@ -19,6 +19,8 @@
|
|||
- (id) removeItemAt: (integer) index;
|
||||
- (id) insertItemAt: (integer) index item:(id) item;
|
||||
- (integer) count;
|
||||
-(void)makeObjectsPerformSelector:(SEL)selector;
|
||||
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg;
|
||||
@end
|
||||
|
||||
#endif//__ruamoko_Array_h
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
for (i = 0; i < count; i++)
|
||||
[array[i] free];
|
||||
obj_free (array);
|
||||
[super free];
|
||||
}
|
||||
|
||||
- (id) getItemAt: (integer) index
|
||||
|
@ -105,4 +106,18 @@
|
|||
return count;
|
||||
}
|
||||
|
||||
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||
{
|
||||
local integer i;
|
||||
for (i = 0; i < count; i++)
|
||||
[array[i] perform:selector];
|
||||
}
|
||||
|
||||
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg
|
||||
{
|
||||
local integer i;
|
||||
for (i = 0; i < count; i++)
|
||||
[array[i] perform:selector withObject:arg];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue