3 #ifndef ANIM_ANIMHOST_H
4 #define ANIM_ANIMHOST_H
5 CLASS(AnimHost, Object)
6 METHOD(AnimHost, addAnim, void(entity, entity))
7 METHOD(AnimHost, removeAnim, void(entity, entity))
8 METHOD(AnimHost, removeAllAnim, void(entity))
9 METHOD(AnimHost, removeObjAnim, void(entity, entity))
10 METHOD(AnimHost, stopAllAnim, void(entity))
11 METHOD(AnimHost, stopObjAnim, void(entity, entity))
12 METHOD(AnimHost, resumeAllAnim, void(entity))
13 METHOD(AnimHost, resumeObjAnim, void(entity, entity))
14 METHOD(AnimHost, finishAllAnim, void(entity))
15 METHOD(AnimHost, finishObjAnim, void(entity, entity))
16 METHOD(AnimHost, tickAll, void(entity))
17 ATTRIB(AnimHost, firstChild, entity, NULL)
18 ATTRIB(AnimHost, lastChild, entity, NULL)
25 void AnimHost_addAnim(entity me, entity other)
28 error("Can't add already added anim!");
30 if(other.isFinished(other))
31 error("Can't add finished anim!");
39 l.nextSibling = other;
41 me.firstChild = other;
43 other.prevSibling = l;
44 other.nextSibling = NULL;
48 void AnimHost_removeAnim(entity me, entity other)
50 if(other.parent != me)
51 error("Can't remove from wrong AnimHost!");
56 n = other.nextSibling;
57 p = other.prevSibling;
71 void AnimHost_removeAllAnim(entity me)
74 for(e = me.firstChild; e; e = e.nextSibling)
78 me.removeAnim(me, tmp);
82 void AnimHost_removeObjAnim(entity me, entity obj)
85 for(e = me.firstChild; e; e = e.nextSibling)
91 me.removeAnim(me, tmp);
96 void AnimHost_stopAllAnim(entity me)
99 for(e = me.firstChild; e; e = e.nextSibling)
105 void AnimHost_stopObjAnim(entity me, entity obj)
108 for(e = me.firstChild; e; e = e.nextSibling)
117 void AnimHost_resumeAllAnim(entity me)
120 for(e = me.firstChild; e; e = e.nextSibling)
126 void AnimHost_resumeObjAnim(entity me, entity obj)
129 for(e = me.firstChild; e; e = e.nextSibling)
138 void AnimHost_finishAllAnim(entity me)
141 for(e = me.firstChild; e; e = e.nextSibling)
149 void AnimHost_finishObjAnim(entity me, entity obj)
152 for(e = me.firstChild; e; e = e.nextSibling)
163 void AnimHost_tickAll(entity me)
166 for(e = me.firstChild; e; e = e.nextSibling)
173 me.removeAnim(me, tmp);