Nuclide
Software Development Kit for id Technology (BETA)
InputDevice.h
1/*
2 * Copyright (c) 2025 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
41{
42public:
43 void ncInputDevice(void);
44
45 virtual void Spawned(void);
46 virtual void WeaponInput(void);
47 virtual void PlayerInput(void);
48
49#ifdef CLIENT
50 virtual bool HideViewWeapon(void);
51 virtual void UpdateView(void);
52 virtual void PredictPreFrame(void);
53 virtual void PredictPostFrame(void);
54 virtual void ReceiveEntity(float flNew, float flSendFlags);
55#endif
56
57#ifdef SERVER
58 virtual void Respawn(void);
59 virtual void OnPlayerUse(void);
60 virtual void EvaluateEntity(void);
61 virtual float SendEntity(entity,float);
62 virtual void SpawnKey(string keyName, string setValue);
63#endif
64
65private:
66 NETWORKED_VECTOR(m_vecSeatOffest)
67 NETWORKED_FLOAT(m_flUseTime)
68};
69
Shared-Entity: Electronics Input Device.
Definition: InputDevice.h:41
virtual void UpdateView(void)
Definition: InputDevice.qc:32
virtual void WeaponInput(void)
Definition: InputDevice.qc:70
virtual void ReceiveEntity(float flNew, float flSendFlags)
Client: Handles network updates from the server for the associated entity.
Definition: InputDevice.qc:123
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: InputDevice.qc:104
virtual void OnPlayerUse(void)
Definition: InputDevice.qc:88
virtual void Spawned(void)
Called when the entity is fully initialized.
Definition: InputDevice.qc:255
virtual void PredictPreFrame(void)
Definition: InputDevice.qc:47
virtual void SpawnKey(string keyName, string setValue)
This method handles entity key/value pairs on map load.
Definition: InputDevice.qc:171
virtual void EvaluateEntity(void)
Run each tic after physics are run to determine if we need to send updates over the network.
Definition: InputDevice.qc:181
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
Definition: InputDevice.qc:210
virtual void PlayerInput(void)
Definition: InputDevice.qc:76
virtual void PredictPostFrame(void)
Definition: InputDevice.qc:58
void ncInputDevice(void)
Definition: InputDevice.qc:18
virtual bool HideViewWeapon(void)
Definition: InputDevice.qc:26
This entity class represents vehicles that are predicted across the network.
Definition: Vehicle.h:33