Nuclide
Software Development Kit for id Tech
entityDef.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023-2024 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
84#ifndef ENTITYDEF_MAX
86#define ENTITYDEF_MAX 256
87#endif
88
90enum
91{
97};
98
100typedef struct
101{
102 string entClass;
104 string spawnData;
106
107 string tweakDefs; /* when (field) equals/greater-than/less-than/is-not (value) */
108 string tweakKeys;
109
110 string eventList; /* model events */
113
114void EntityDef_Init(void);
115void EntityDef_DebugList(void);
116string EntityDef_GetKeyValue(string, string);
117
118int EntityDef_IDFromName(string);
119string EntityDef_NameFromID(int);
120string EntityDef_GetSpawnData(int);
121bool EntityDef_HasSpawnClass(string className);
122
123#ifdef SERVER
124bool EntityDef_Precache(string);
125NSEntity Entity_CreateClass(string className);
126#endif
127 // end of entitydef
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:54
string EntityDef_GetKeyValue(string, string)
Retrieves the value of a specific key defined within an EntityDef.
Definition: entityDef.qc:282
string EntityDef_NameFromID(int)
Definition: entityDef.qc:622
string EntityDef_GetSpawnData(int)
Definition: entityDef.qc:633
bool EntityDef_HasSpawnClass(string className)
Checks if an entity class was defined in an EntityDef.
Definition: entityDef.qc:576
void EntityDef_DebugList(void)
Definition: entityDef.qc:588
int EntityDef_IDFromName(string)
Definition: entityDef.qc:608
void EntityDef_Init(void)
Definition: entityDef.qc:170
bool EntityDef_Precache(string)
Definition: entityDef.qc:490
NSEntity Entity_CreateClass(string className)
Always returns a valid entity.
Definition: entityDef.qc:562
@ EDEFTWEAK_GT
Greater-Than Check.
Definition: entityDef.h:94
@ EDEFTWEAK_LT
Less-Than Check.
Definition: entityDef.h:93
@ EDEFTWEAK_NOT
Not (Invert) Gate.
Definition: entityDef.h:95
@ EDEFTWEAK_EQ
Equals Check.
Definition: entityDef.h:92
@ EDEFTWEAK_CONTAINS
Contains Bit (&) Check.
Definition: entityDef.h:96
Data holding EntityDef entries.
Definition: entityDef.h:101
string entClass
Definition: entityDef.h:102
string spawnData
Definition: entityDef.h:104
string eventList
Definition: entityDef.h:110
int inheritID
Definition: entityDef.h:111
string spawnClass
Definition: entityDef.h:103
string tweakDefs
Definition: entityDef.h:107
string tweakKeys
Definition: entityDef.h:108
string inheritKeys
Definition: entityDef.h:105