mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Added a removeItem method to the Array Ruamoko class.
This commit is contained in:
parent
e2061095a6
commit
cc3f98e99c
2 changed files with 14 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
- (void []) getItemAt: (integer) index;
|
||||
- (void) setItemAt: (integer) index item:(void []) item;
|
||||
- (void) addItem: (void []) item;
|
||||
- (void) removeItem: (void []) item;
|
||||
- (void []) removeItemAt: (integer) index;
|
||||
- (void []) insertItemAt: (integer) index item:(void []) item;
|
||||
- (integer) count;
|
||||
|
|
|
@ -53,6 +53,19 @@
|
|||
array[count++] = item;
|
||||
}
|
||||
|
||||
- (void) removeItem: (void []) item
|
||||
{
|
||||
local integer i, n;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
if (array[i] == item) {
|
||||
count--;
|
||||
for (n = i; n < count; n++)
|
||||
array[n] = array[n + 1];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
- (void []) removeItemAt: (integer) index
|
||||
{
|
||||
local integer i;
|
||||
|
|
Loading…
Reference in a new issue