Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
animhost.qc
Go to the documentation of this file.
1#include "animhost.qh"
2
3#include "../menu.qh"
4
5#include "animation.qh"
6
7 .entity parent;
9 {
10 if (other.parent) error("Can't add already added anim!");
11 if (other.finished) error("Can't add finished anim!");
12
13 other.parent = this;
14
15 entity l = this.lastChild;
16
17 if (l) l.nextSibling = other;
18 else this.firstChild = other;
19
20 other.prevSibling = l;
21 other.nextSibling = NULL;
22 this.lastChild = other;
23 }
24
26 {
27 if (other.parent != this) error("Can't remove from wrong AnimHost!");
28
29 other.parent = NULL;
30
31 entity n = other.nextSibling;
32 entity p = other.prevSibling;
33
34 if (p) p.nextSibling = n;
35 else this.firstChild = n;
36
37 if (n) n.prevSibling = p;
38 else this.lastChild = p;
39 delete(other);
40 }
41
43 {
44 for (entity e = this.firstChild; e; e = e.nextSibling)
45 {
46 entity tmp = e;
47 e = tmp.prevSibling;
48 this.removeAnim(this, tmp);
49 }
50 }
51
53 {
54 for (entity e = this.firstChild; e; e = e.nextSibling)
55 {
56 if (e.object == obj)
57 {
58 entity tmp = e;
59 e = tmp.prevSibling;
60 this.removeAnim(this, tmp);
61 }
62 }
63 }
64
66 {
67 for (entity e = this.firstChild; e; e = e.nextSibling)
68 e.stopAnim(e);
69 }
70
72 {
73 for (entity e = this.firstChild; e; e = e.nextSibling)
74 if (e.object == obj) e.stopAnim(e);
75 }
76
78 {
79 for (entity e = this.firstChild; e; e = e.nextSibling)
80 e.resumeAnim(e);
81 }
82
84 {
85 for (entity e = this.firstChild; e; e = e.nextSibling)
86 if (e.object == obj) e.resumeAnim(e);
87 }
88
90 {
91 for (entity e = this.firstChild; e; e = e.nextSibling)
92 {
93 entity tmp = e;
94 e = tmp.prevSibling;
95 tmp.finishAnim(tmp);
96 }
97 }
98
100 {
101 for (entity e = this.firstChild; e; e = e.nextSibling)
102 {
103 if (e.object == obj)
104 {
105 entity tmp = e;
106 e = tmp.prevSibling;
107 tmp.finishAnim(tmp);
108 }
109 }
110 }
111
113 {
114 for (entity e = this.firstChild; e; e = e.nextSibling)
115 {
116 e.tick(e, time);
117 if (e.finished)
118 {
119 entity tmp = e;
120 e = tmp.prevSibling;
121 this.removeAnim(this, tmp);
122 }
123 }
124 }
entity parent
Definition animhost.qc:7
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
virtual void addAnim()
Definition animhost.qc:8
virtual void resumeObjAnim()
Definition animhost.qc:83
virtual void finishAllAnim()
Definition animhost.qc:89
virtual void stopAllAnim()
Definition animhost.qc:65
virtual void stopObjAnim()
Definition animhost.qc:71
virtual void finishObjAnim()
Definition animhost.qc:99
virtual void tickAll()
Definition animhost.qc:112
virtual void removeAllAnim()
Definition animhost.qc:42
virtual void removeAnim()
Definition animhost.qc:25
virtual void removeObjAnim()
Definition animhost.qc:52
virtual void resumeAllAnim()
Definition animhost.qc:77
entity other
float time
entity firstChild
Definition menu_cmd.qc:12
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define NULL
Definition post.qh:14
#define error
Definition pre.qh:6