|
VoltMod
C++23 framework for CS2 server plugins
|
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see Entity.
More...
#include <EntitySystem.hpp>
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see Entity.
Definition at line 39 of file EntitySystem.hpp.
| VoltMod::EntitySystem::EntitySystem | ( | VoltMod::Interfaces & | interfaces, |
| const VoltMod::Bindings & | bindings | ||
| ) |
Reads the entity system, which is null before the first map. interfaces and bindings must outlive this service.
Definition at line 34 of file EntitySystem.cpp.
References VoltMod::Bindings::GameEntitySystem, VoltMod::Interfaces::GameResourceService, VoltMod::Log::Info(), Raw(), and VoltMod::Offset< T >::Value().
| VoltMod::EntitySystem::~EntitySystem | ( | ) |
Definition at line 44 of file EntitySystem.cpp.
References VoltMod::Interfaces::EntitySystem, and g_entitySystem.
|
delete |
| Status VoltMod::EntitySystem::Available | ( | ) | const |
An error when entity lookups can never work, or entities cannot be created or spawned. A missing system before the first map is fine: OnServerStartup picks it up.
Definition at line 13 of file EntitySystemSpawn.cpp.
References VoltMod::Bindings::CreateEntityByName, VoltMod::Bindings::DispatchSpawn, VoltMod::Bindings::GameEntitySystem, VoltMod::Interfaces::GameResourceService, VoltMod::Error::NotReady(), and VoltMod::Error::Unsupported().
Referenced by Create().
|
inlinenoexcept |
What the wrappers' verbs call the engine through.
Definition at line 99 of file EntitySystem.hpp.
Referenced by VoltMod::Entity::AcceptInput(), VoltMod::Controller::ChangeTeam(), VoltMod::Entity::EmitSound(), VoltMod::Entity::EmitSound(), VoltMod::Pawn::GiveItem(), VoltMod::Entity::RemoveAfter(), VoltMod::Controller::Respawn(), VoltMod::Pawn::SelectWeapon(), VoltMod::Entity::SetModel(), VoltMod::Entity::SetScale(), VoltMod::Pawn::Slay(), VoltMod::Entity::Spawn(), VoltMod::Entity::StopSound(), VoltMod::Pawn::StripWeapons(), and VoltMod::Entity::Teleport().
| VoltMod::Controller VoltMod::EntitySystem::Controller | ( | int | slot | ) |
The controller in slot; falsy when the slot is empty.
Definition at line 143 of file EntitySystem.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::Pawn::Controller(), VoltMod::Player::Controller(), VoltMod::Player::Name(), and VoltMod::Visibility::OnCheckTransmit().
| Entity VoltMod::EntitySystem::Create | ( | std::string_view | className | ) |
A new entity that has not spawned yet: set its fields, then call Entity::Spawn.
Definition at line 30 of file EntitySystemSpawn.cpp.
References Available(), VoltMod::Bindings::CreateEntityByName, and VoltMod::ReadFile().
Referenced by Spawn(), SpawnBeam(), SpawnLine(), and SpawnProp().
| Entity VoltMod::EntitySystem::Find | ( | std::string_view | className | ) |
The first entity of className, such as "cs_gamerules"; * wildcards match.
Definition at line 158 of file EntitySystem.cpp.
References Raw(), and VoltMod::ReadFile().
| std::vector< Entity > VoltMod::EntitySystem::FindAll | ( | std::string_view | className | ) |
Every entity of className, taken now, so removing them while looping is safe.
Definition at line 171 of file EntitySystem.cpp.
References Raw(), and VoltMod::ReadFile().
What ref points at; falsy when it is unset, or its entity is gone or replaced.
Definition at line 108 of file EntitySystem.cpp.
References Raw(), and VoltMod::ReadFile().
Referenced by VoltMod::Damage::Apply(), VoltMod::ScreenEntity::Exists(), VoltMod::Pawn::HoldFire(), VoltMod::Controller::InputPawn(), VoltMod::Visibility::OnCheckTransmit(), VoltMod::GlowVision::Refresh(), VoltMod::ScreenEntity::Remove(), VoltMod::Pawn::RemoveWeapon(), VoltMod::Pawn::Slot(), and VoltMod::Pawn::Weapons().
|
inlinenoexcept |
Definition at line 100 of file EntitySystem.hpp.
Referenced by VoltMod::Controller::ExecuteCommand(), and VoltMod::Controller::Kick().
| void VoltMod::EntitySystem::OnServerStartup | ( | ) |
Re-read the system for the new map.
Definition at line 82 of file EntitySystem.cpp.
References VoltMod::Log::Error(), VoltMod::Log::Info(), and Raw().
|
delete |
| VoltMod::Pawn VoltMod::EntitySystem::Pawn | ( | EntityRef | ref | ) |
The player pawn ref points at; falsy when it is gone or not a player pawn.
Definition at line 153 of file EntitySystem.cpp.
References VoltMod::Entity::AsPawn(), VoltMod::Get, and VoltMod::ReadFile().
| VoltMod::Pawn VoltMod::EntitySystem::Pawn | ( | int | slot | ) |
The living body of slot's player; falsy when there is none.
Definition at line 148 of file EntitySystem.cpp.
References VoltMod::Controller::Pawn(), and VoltMod::ReadFile().
Referenced by VoltMod::MenuFreeze::Close(), VoltMod::MenuFreeze::Enable(), VoltMod::MenuFreeze::Open(), VoltMod::Player::Pawn(), VoltMod::GlowVision::Refresh(), and VoltMod::EngineArgBinder::Resolve().
| CGameEntitySystem * VoltMod::EntitySystem::Raw | ( | ) |
The engine's entity system; null before the first map.
Definition at line 97 of file EntitySystem.cpp.
References VoltMod::Interfaces::EntitySystem.
Referenced by EntitySystem(), Find(), FindAll(), Get(), OnServerStartup(), and VoltMod::Entity::RemoveAfter().
Create and spawn; falsy on failure. The engine takes the keyvalues.
Definition at line 40 of file EntitySystemSpawn.cpp.
References Create(), and VoltMod::ReadFile().
Referenced by SpawnParticle().
| Entity VoltMod::EntitySystem::SpawnBeam | ( | const Vector & | from, |
| const Vector & | to, | ||
| float | width, | ||
| Color | color | ||
| ) |
A straight line of width from from to to.
Definition at line 114 of file EntitySystemSpawn.cpp.
References Create(), VoltMod::Schema::kRenderNormal, VoltMod::ReadFile(), VoltMod::KeyValues::Set(), and VoltMod::Schema::CBeam::SetWidth().
| Entity VoltMod::EntitySystem::SpawnLine | ( | std::string_view | effect, |
| const Vector & | from, | ||
| EntityRef | end | ||
| ) |
A running particle effect from from whose control point 1 follows end, such as a tracer to its target. Linked by handle, so neither entity needs a name.
Definition at line 93 of file EntitySystemSpawn.cpp.
References Create(), VoltMod::ReadFile(), VoltMod::KeyValues::Set(), and VoltMod::Schema::CParticleSystem::SetControlPointRef().
| Entity VoltMod::EntitySystem::SpawnParticle | ( | std::string_view | effect, |
| const Vector & | origin, | ||
| const QAngle & | angles = {0.0f, 0.0f, 0.0f} |
||
| ) |
A running particle effect such as "particles/explosion.vpcf"; empty for an empty name. Remove it to stop it.
Definition at line 82 of file EntitySystemSpawn.cpp.
References VoltMod::ReadFile(), VoltMod::KeyValues::Set(), and Spawn().
A prop_dynamic; falsy when it did not spawn.
Definition at line 47 of file EntitySystemSpawn.cpp.
References Create(), VoltMod::ReadFile(), VoltMod::KeyValues::Set(), VoltMod::SolidNone, and VoltMod::SolidVPhysics.