chore: add clang-format and pre-commit configuration

This commit is contained in:
2026-04-28 09:22:55 +08:00
parent dc3be5a4bc
commit 611a795481
62 changed files with 2166 additions and 2134 deletions

View File

@@ -5,22 +5,17 @@
namespace Cubed {
enum class GameMode {
CREATIVE = 0,
SPECTATOR
};
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"};
case CREATIVE:
return {"Creative"};
case SPECTATOR:
return {"Spective"};
}
throw std::invalid_argument{"GameMode is invaild"};
}
}
} // namespace Cubed