Nuclide
Software Development Kit for id Technology
entityDef.h
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
93#ifndef ENTITYDEF_MAX
95#define ENTITYDEF_MAX 256
96#endif
97
99enum
100{
107
109typedef struct
110{
111 string entClass;
113 string spawnData;
115
116 string tweakDefs; /* when (field) equals/greater-than/less-than/is-not (value) */
117 string tweakKeys;
118
119 string eventList; /* model events */
122
123void EntityDef_Init(void);
124void EntityDef_DebugList(void);
125string EntityDef_GetKeyValue(string, string);
126int EntityDef_NetIDFromName(string);
127string EntityDef_NameFromNetID(int);
128int EntityDef_IDFromName(string);
129string EntityDef_GetSpawnData(int);
130bool EntityDef_HasSpawnClass(string className);
131
132#ifdef SERVER
133bool EntityDef_Precache(string);
134NSEntity EntityDef_SwitchClass(NSEntity target, string className);
135NSEntity Entity_CreateClass(string className);
136
137NSEntity EntityDef_NewClassname(string className);
138#endif
139 // end of entitydef
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:54
int EntityDef_NetIDFromName(string)
Definition: entityDef.qc:656
string EntityDef_GetKeyValue(string, string)
Retrieves the value of a specific key defined within an EntityDef.
Definition: entityDef.qc:283
string EntityDef_GetSpawnData(int)
Definition: entityDef.qc:702
bool EntityDef_HasSpawnClass(string className)
Checks if an entity class was defined in an EntityDef.
Definition: entityDef.qc:618
void EntityDef_DebugList(void)
Definition: entityDef.qc:630
int EntityDef_IDFromName(string)
Definition: entityDef.qc:674
void EntityDef_Init(void)
Definition: entityDef.qc:173
NSEntity EntityDef_SwitchClass(NSEntity target, string className)
Definition: entityDef.qc:553
bool EntityDef_Precache(string)
Definition: entityDef.qc:484
string EntityDef_NameFromNetID(int)
Definition: entityDef.qc:688
NSEntity Entity_CreateClass(string className)
Always returns a valid entity.
Definition: entityDef.qc:604
NSEntity EntityDef_NewClassname(string className)
Definition: entityDef.qc:507
@ EDEFTWEAK_GT
Greater-Than Check.
Definition: entityDef.h:103
@ EDEFTWEAK_LT
Less-Than Check.
Definition: entityDef.h:102
@ EDEFTWEAK_NOT
Not (Invert) Gate.
Definition: entityDef.h:104
@ EDEFTWEAK_EQ
Equals Check.
Definition: entityDef.h:101
@ EDEFTWEAK_CONTAINS
Contains Bit (&) Check.
Definition: entityDef.h:105
Data holding EntityDef entries.
Definition: entityDef.h:110
string entClass
Definition: entityDef.h:111
string spawnData
Definition: entityDef.h:113
string eventList
Definition: entityDef.h:119
int inheritID
Definition: entityDef.h:120
string spawnClass
Definition: entityDef.h:112
string tweakDefs
Definition: entityDef.h:116
string tweakKeys
Definition: entityDef.h:117
string inheritKeys
Definition: entityDef.h:114