mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat: add Spectator Mode
This commit is contained in:
19
include/Cubed/gameplay/game_mode.hpp
Normal file
19
include/Cubed/gameplay/game_mode.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
enum class GameMode {
|
||||
CREATIVE,
|
||||
SPECTATOR
|
||||
};
|
||||
|
||||
inline std::string to_str(GameMode mode) {
|
||||
using enum GameMode;
|
||||
switch (mode) {
|
||||
case CREATIVE:
|
||||
return {"Creative"};
|
||||
case SPECTATOR:
|
||||
return {"Spective"};
|
||||
}
|
||||
throw std::invalid_argument{"GameMode is invaild"};
|
||||
}
|
||||
Reference in New Issue
Block a user