MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / StringToGameMode

Method StringToGameMode

Sources/Jazz2/Multiplayer/NetworkManager.cpp:641–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639 }
640
641 MpGameMode NetworkManager::StringToGameMode(StringView value)
642 {
643 auto gameModeString = StringUtils::lowercase(value);
644 if (gameModeString == "battle"sv || gameModeString == "b"sv) {
645 return MpGameMode::Battle;
646 } else if (gameModeString == "teambattle"_s || gameModeString == "tb"_s) {
647 return MpGameMode::TeamBattle;
648 } else if (gameModeString == "race"_s || gameModeString == "r"_s) {
649 return MpGameMode::Race;
650 } else if (gameModeString == "teamrace"_s || gameModeString == "tr"_s) {
651 return MpGameMode::TeamRace;
652 } else if (gameModeString == "treasurehunt"_s || gameModeString == "th"_s) {
653 return MpGameMode::TreasureHunt;
654 } else if (gameModeString == "teamtreasurehunt"_s || gameModeString == "tth"_s) {
655 return MpGameMode::TeamTreasureHunt;
656 } else if (gameModeString == "capturetheflag"_s || gameModeString == "ctf"_s) {
657 return MpGameMode::CaptureTheFlag;
658 } else if (gameModeString == "cooperation"_s || gameModeString == "coop"_s || gameModeString == "c"_s) {
659 return MpGameMode::Cooperation;
660 } else {
661 return MpGameMode::Unknown;
662 }
663 }
664
665 String NetworkManager::UuidToString(StaticArrayView<Uuid::Size, Uuid::Type> uuid)
666 {

Callers

nothing calls this directly

Calls 1

lowercaseFunction · 0.85

Tested by

no test coverage detected