Last change
on this file since 1247 was
343,
checked in by Maciej Komosinski, 10 years ago
|
Code formatting
|
-
Property svn:eol-style set to
native
|
File size:
704 bytes
|
Rev | Line | |
---|
[286] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
| 2 | // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. |
---|
| 3 | // See LICENSE.txt for details. |
---|
[109] | 4 | |
---|
| 5 | #include <stdlib.h> |
---|
| 6 | #include <string.h> |
---|
| 7 | #include <stdio.h> |
---|
| 8 | #include "advlist.h" |
---|
| 9 | |
---|
| 10 | void AdvList::remove(int i) |
---|
| 11 | { |
---|
[343] | 12 | l_del.action(i); |
---|
| 13 | SList::remove(i); |
---|
| 14 | l_postdel.action(i); |
---|
[109] | 15 | } |
---|
| 16 | |
---|
| 17 | void AdvList::clear() |
---|
| 18 | { |
---|
[343] | 19 | int i; |
---|
| 20 | for (i = size() - 1; i >= 0; i--) remove(i); |
---|
| 21 | resize(0); |
---|
| 22 | used = 0; |
---|
[109] | 23 | } |
---|
| 24 | |
---|
| 25 | void AdvList::operator-=(void* e) |
---|
| 26 | { |
---|
[343] | 27 | int i = find(e); |
---|
| 28 | if (i >= 0) remove(i); |
---|
[109] | 29 | } |
---|
| 30 | |
---|
| 31 | int AdvList::operator+=(void* e) |
---|
| 32 | { |
---|
[343] | 33 | int p = size(); |
---|
| 34 | SList::operator+=(e); |
---|
| 35 | l_add.action(p); |
---|
| 36 | return p; |
---|
[109] | 37 | } |
---|
| 38 | |
---|
| 39 | void AdvList::mod(int x) |
---|
| 40 | { |
---|
[343] | 41 | if (x < -1) x = -1; |
---|
| 42 | l_mod.action(x); |
---|
[109] | 43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.