Nuclide
Software Development Kit for id Technology (BETA)
AddonDelegate.h
1/*
2 * Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
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
100{
101public:
102 void ncAddonDelegate(void);
103
105 virtual void Load(void);
107 virtual void Shutdown(void);
108
110 virtual bool ConsoleCommand(ncPlayer,string);
112 virtual bool ClientCommand(ncClient, string);
114 virtual void PlayerConnect(ncPlayer);
116 virtual void PlayerDisconnect(ncPlayer);
118 virtual void PlayerSpawn(ncPlayer);
120 virtual void PlayerDeath(ncPlayer, ncEntity, ncEntity, string);
122 virtual void NPCDeath(ncActor, ncEntity, ncEntity);
123
125 virtual void LinkProgs(void);
126
130 nonvirtual ncAddonDelegate CreateFromProgs(string addonName, float progsHandle);
131
133 nonvirtual void Close(void);
134
136 nonvirtual string Name(void);
137
138private:
139 float m_progHandle;
140 string m_name;
141};
142
143#define ADDON_LINK(y, z) this.y = externvalue(m_progHandle, z); if (!this.y) { this.y = ncAddonDelegate::y; }
This entity class represents an object with choreographed/free-form movement.
Definition: Actor.h:90
This is a delegate class for individual active AddonC plugins.
Definition: AddonDelegate.h:100
virtual void PlayerDeath(ncPlayer, ncEntity, ncEntity, string)
Overridable: Called when a ncPlayer dies in the game.
Definition: AddonDelegate.qc:69
nonvirtual void Close(void)
Closes the addon.
Definition: AddonDelegate.qc:85
nonvirtual ncAddonDelegate CreateFromProgs(string addonName, float progsHandle)
Creates an addon delegate from a progs handle.
Definition: AddonDelegate.qc:111
nonvirtual string Name(void)
Returns the name of the addon.
Definition: AddonDelegate.qc:79
virtual bool ClientCommand(ncClient, string)
Overridable: Called when a client issues a client command.
Definition: AddonDelegate.qc:48
virtual void Load(void)
Overridable: Called when the plugin gets loaded.
Definition: AddonDelegate.qc:32
virtual bool ConsoleCommand(ncPlayer, string)
Overridable: Called when the server issues a console command.
Definition: AddonDelegate.qc:42
virtual void PlayerDisconnect(ncPlayer)
Overridable: Called when a ncPlayer leaves the server.
Definition: AddonDelegate.qc:59
void ncAddonDelegate(void)
Definition: AddonDelegate.qc:24
virtual void LinkProgs(void)
Called to link functions defined within multiprogs with the delegate's methods.
Definition: AddonDelegate.qc:97
virtual void Shutdown(void)
Overridable: Called when the plugin gets unloaded.
Definition: AddonDelegate.qc:37
virtual void PlayerConnect(ncPlayer)
Overridable: Called when a ncPlayer joins the server.
Definition: AddonDelegate.qc:54
virtual void PlayerSpawn(ncPlayer)
Overridable: Called when a ncPlayer spawns, called sometime after joining.
Definition: AddonDelegate.qc:74
virtual void NPCDeath(ncActor, ncEntity, ncEntity)
Overridable:: Called when an NPC gets killed.
Definition: AddonDelegate.qc:64
This entity class is the lowest client/player class.
Definition: Client.h:26
ncEntity is the lowest of the user-accessible entity class.
Definition: Entity.h:75
This entity class represents every player client.
Definition: Player.h:64