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