mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
21 lines
393 B
C++
21 lines
393 B
C++
#pragma once
|
|
|
|
#include <stdexcept>
|
|
#include <string>
|
|
|
|
namespace Cubed {
|
|
|
|
enum class GameMode { CREATIVE = 0, 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"};
|
|
}
|
|
|
|
} // namespace Cubed
|