22 lines
		
	
	
	
		
			513 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			513 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| #include <string>
 | |
| #include <filesystem>
 | |
| #include <memory>
 | |
| #include <unordered_map>
 | |
| #include <SFML/Audio.hpp>
 | |
| 
 | |
| struct SoundPair {
 | |
|   sf::SoundBuffer buffer;
 | |
|   sf::Sound sound;
 | |
| };
 | |
| 
 | |
| struct SoundManager {
 | |
|   std::filesystem::path $base_path;
 | |
|   std::unordered_map<std::string, SoundPair* > $sounds;
 | |
| 
 | |
|   SoundManager(std::string base_path);
 | |
| 
 | |
|   void load(const std::string name, const std::string path);
 | |
|   void play(const std::string name);
 | |
|   void playAt(const std::string name, float x, float y, float z);
 | |
| };
 | 
