UFO: Alien Invasion
srvedict.h
Go to the documentation of this file.
1
6/*
7All original material Copyright (C) 2002-2022 UFO: Alien Invasion.
8
9Original file from Quake 2 v3.21: quake2-2.31/game/game.h
10Copyright (C) 1997-2001 Id Software, Inc.
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21See the GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27*/
28
29#pragma once
30
31#include "../shared/ufotypes.h"
32
34class SrvEdict {
35public:
36 bool inuse;
40 int number;
51
56 const char* classname;
57
58 inline SrvEdict* child () { /* only needed for SV_LinkEdict */
59 return _child;
60 }
61 inline SrvEdict* owner () const { /* only used in isParentship, which is only used in SV_ClipMoveToEntities, called only by SV_Trace */
62 return _owner;
63 }
64 inline bool isSameAs (const SrvEdict* other) const {
65 if (!other)
66 return false;
67 return number == other->number;
68 }
69 inline bool isParentship (const SrvEdict* other) const {
70 if (other) {
71 if (other->owner() && other->owner()->isSameAs(this))
72 return true;
73 if (this->owner() && this->owner()->isSameAs(other))
74 return true;
75 }
76 return false;
77 }
78};
Definition: aabb.h:42
SrvEdict * _child
Definition: srvedict.h:52
int modelindex
Definition: srvedict.h:54
vec3_t angles
Definition: srvedict.h:43
bool inuse
Definition: srvedict.h:36
SrvEdict * child()
Definition: srvedict.h:58
vec3_t size
Definition: srvedict.h:50
pos3_t pos
Definition: srvedict.h:44
solid_t solid
Definition: srvedict.h:46
bool isParentship(const SrvEdict *other) const
Definition: srvedict.h:69
AABB absBox
Definition: srvedict.h:49
SrvEdict * _owner
Definition: srvedict.h:53
AABB entBox
Definition: srvedict.h:48
const char * classname
Definition: srvedict.h:56
SrvEdict * owner() const
Definition: srvedict.h:61
bool isSameAs(const SrvEdict *other) const
Definition: srvedict.h:64
int number
Definition: srvedict.h:40
vec3_t origin
Definition: srvedict.h:42
int linkcount
Definition: srvedict.h:37
solid_t
edict->solid values
Definition: game.h:153
pos_t pos3_t[3]
Definition: ufotypes.h:58
vec_t vec3_t[3]
Definition: ufotypes.h:39