3 #ifndef ANIM_ANIMHOST_H
4 #define ANIM_ANIMHOST_H
5 #include "../oo/base.qh"
6 CLASS(AnimHost, Object)
7 METHOD(AnimHost, addAnim, void(entity, entity));
8 METHOD(AnimHost, removeAnim, void(entity, entity));
9 METHOD(AnimHost, removeAllAnim, void(entity));
10 METHOD(AnimHost, removeObjAnim, void(entity, entity));
11 METHOD(AnimHost, stopAllAnim, void(entity));
12 METHOD(AnimHost, stopObjAnim, void(entity, entity));
13 METHOD(AnimHost, resumeAllAnim, void(entity));
14 METHOD(AnimHost, resumeObjAnim, void(entity, entity));
15 METHOD(AnimHost, finishAllAnim, void(entity));
16 METHOD(AnimHost, finishObjAnim, void(entity, entity));
17 METHOD(AnimHost, tickAll, void(entity));
18 ATTRIB(AnimHost, firstChild, entity, NULL)
19 ATTRIB(AnimHost, lastChild, entity, NULL)
26 void AnimHost_addAnim(entity me, entity other)
29 error("Can't add already added anim!");
31 if(other.isFinished(other))
32 error("Can't add finished anim!");
40 l.nextSibling = other;
42 me.firstChild = other;
44 other.prevSibling = l;
45 other.nextSibling = NULL;
49 void AnimHost_removeAnim(entity me, entity other)
51 if(other.parent != me)
52 error("Can't remove from wrong AnimHost!");
57 n = other.nextSibling;
58 p = other.prevSibling;
72 void AnimHost_removeAllAnim(entity me)
75 for(e = me.firstChild; e; e = e.nextSibling)
79 me.removeAnim(me, tmp);
83 void AnimHost_removeObjAnim(entity me, entity obj)
86 for(e = me.firstChild; e; e = e.nextSibling)
92 me.removeAnim(me, tmp);
97 void AnimHost_stopAllAnim(entity me)
100 for(e = me.firstChild; e; e = e.nextSibling)
106 void AnimHost_stopObjAnim(entity me, entity obj)
109 for(e = me.firstChild; e; e = e.nextSibling)
118 void AnimHost_resumeAllAnim(entity me)
121 for(e = me.firstChild; e; e = e.nextSibling)
127 void AnimHost_resumeObjAnim(entity me, entity obj)
130 for(e = me.firstChild; e; e = e.nextSibling)
139 void AnimHost_finishAllAnim(entity me)
142 for(e = me.firstChild; e; e = e.nextSibling)
150 void AnimHost_finishObjAnim(entity me, entity obj)
153 for(e = me.firstChild; e; e = e.nextSibling)
164 void AnimHost_tickAll(entity me)
167 for(e = me.firstChild; e; e = e.nextSibling)
174 me.removeAnim(me, tmp);