Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
AnimHost Class Reference
Inheritance diagram for AnimHost:
Collaboration diagram for AnimHost:

Public Member Functions

virtual void addAnim ()
 ATTRIB (AnimHost, firstChild, entity)
 ATTRIB (AnimHost, lastChild, entity)
virtual void finishAllAnim ()
virtual void finishObjAnim ()
virtual void removeAllAnim ()
virtual void removeAnim ()
virtual void removeObjAnim ()
virtual void resumeAllAnim ()
virtual void resumeObjAnim ()
virtual void stopAllAnim ()
virtual void stopObjAnim ()
virtual void tickAll ()

Detailed Description

Definition at line 5 of file animhost.qh.

Member Function Documentation

◆ addAnim()

void AnimHost::addAnim ( )
virtual

Definition at line 8 of file animhost.qc.

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 }
entity other
entity() spawn
entity firstChild
Definition menu_cmd.qc:12
#define NULL
Definition post.qh:14
#define error
Definition pre.qh:6

References addAnim(), entity(), error, firstChild, NULL, and other.

Referenced by addAnim().

◆ ATTRIB() [1/2]

AnimHost::ATTRIB ( AnimHost ,
firstChild ,
entity  )

References entity(), and firstChild.

◆ ATTRIB() [2/2]

AnimHost::ATTRIB ( AnimHost ,
lastChild ,
entity  )

References entity().

◆ finishAllAnim()

void AnimHost::finishAllAnim ( )
virtual

Definition at line 89 of file animhost.qc.

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 }

References entity(), finishAllAnim(), and firstChild.

Referenced by finishAllAnim().

◆ finishObjAnim()

void AnimHost::finishObjAnim ( )
virtual

Definition at line 99 of file animhost.qc.

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 }

References entity(), finishObjAnim(), and firstChild.

Referenced by finishObjAnim().

◆ removeAllAnim()

void AnimHost::removeAllAnim ( )
virtual

Definition at line 42 of file animhost.qc.

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 }
virtual void removeAnim()
Definition animhost.qc:25

References entity(), firstChild, removeAllAnim(), and removeAnim().

Referenced by removeAllAnim().

◆ removeAnim()

void AnimHost::removeAnim ( )
virtual

Definition at line 25 of file animhost.qc.

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 }

References entity(), error, firstChild, NULL, other, and removeAnim().

Referenced by removeAllAnim(), removeAnim(), removeObjAnim(), and tickAll().

◆ removeObjAnim()

void AnimHost::removeObjAnim ( )
virtual

Definition at line 52 of file animhost.qc.

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 }

References entity(), firstChild, removeAnim(), and removeObjAnim().

Referenced by removeObjAnim().

◆ resumeAllAnim()

void AnimHost::resumeAllAnim ( )
virtual

Definition at line 77 of file animhost.qc.

78 {
79 for (entity e = this.firstChild; e; e = e.nextSibling)
80 e.resumeAnim(e);
81 }

References entity(), firstChild, and resumeAllAnim().

Referenced by resumeAllAnim().

◆ resumeObjAnim()

void AnimHost::resumeObjAnim ( )
virtual

Definition at line 83 of file animhost.qc.

84 {
85 for (entity e = this.firstChild; e; e = e.nextSibling)
86 if (e.object == obj) e.resumeAnim(e);
87 }

References entity(), firstChild, and resumeObjAnim().

Referenced by resumeObjAnim().

◆ stopAllAnim()

void AnimHost::stopAllAnim ( )
virtual

Definition at line 65 of file animhost.qc.

66 {
67 for (entity e = this.firstChild; e; e = e.nextSibling)
68 e.stopAnim(e);
69 }

References entity(), firstChild, and stopAllAnim().

Referenced by stopAllAnim().

◆ stopObjAnim()

void AnimHost::stopObjAnim ( )
virtual

Definition at line 71 of file animhost.qc.

72 {
73 for (entity e = this.firstChild; e; e = e.nextSibling)
74 if (e.object == obj) e.stopAnim(e);
75 }

References entity(), firstChild, and stopObjAnim().

Referenced by stopObjAnim().

◆ tickAll()

void AnimHost::tickAll ( )
virtual

Definition at line 112 of file animhost.qc.

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 }
float time

References entity(), firstChild, removeAnim(), tickAll(), and time.

Referenced by tickAll().


The documentation for this class was generated from the following files: