yapb-noob-edition/inc/sounds.h
jeefo 7f4d4748fa
fix: center-screen messages not appearing (fix: #446)
fix: crash when creating too much threads
refactor: fix typos in comments in headers
2023-05-12 22:12:22 +03:00

40 lines
871 B
C++

//
// YaPB - Counter-Strike Bot based on PODBot by Markus Klinge.
// Copyright © 2004-2023 YaPB Project <yapb@jeefo.net>.
//
// SPDX-License-Identifier: MIT
//
#pragma once
// noise types
CR_DECLARE_SCOPED_ENUM (Noise,
NeedHandle = cr::bit (0),
HitFall = cr::bit (1),
Pickup = cr::bit (2),
Zoom = cr::bit (3),
Ammo = cr::bit (4),
Hostage = cr::bit (5),
Broke = cr::bit (6),
Door = cr::bit (7),
Defuse = cr::bit (8)
)
class BotSounds final : public Singleton <BotSounds> {
private:
HashMap <String, int32_t> m_noiseCache {};
public:
BotSounds ();
~BotSounds () = default;
public:
// attaches sound to client struct
void listenNoise (edict_t *ent, StringRef sample, float volume);
// simulate sound for players
void simulateNoise (int playerIndex);
};
// expose global
CR_EXPOSE_GLOBAL_SINGLETON (BotSounds, sounds);