-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
87 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
About: rustext player | ||
Author: ziggi | ||
*/ | ||
|
||
#include "russifier.hpp" | ||
|
||
std::map <int, Converter::Types> Russifier::gPlayerTypesMap; | ||
Converter::Types Russifier::gDefaultType; | ||
|
||
void Russifier::SetPlayerType(int playerid, Converter::Types type) | ||
{ | ||
gPlayerTypesMap[playerid] = type; | ||
} | ||
|
||
void Russifier::SetPlayerType(int playerid, int type) | ||
{ | ||
gPlayerTypesMap[playerid] = static_cast<Converter::Types>(type); | ||
} | ||
|
||
Converter::Types Russifier::GetPlayerType(int playerid) | ||
{ | ||
if (gPlayerTypesMap.find(playerid) == gPlayerTypesMap.end()) { | ||
return gDefaultType; | ||
} | ||
return gPlayerTypesMap[playerid]; | ||
} | ||
|
||
void Russifier::SetDefaultType(Converter::Types type) | ||
{ | ||
gDefaultType = type; | ||
} | ||
|
||
void Russifier::SetDefaultType(int type) | ||
{ | ||
gDefaultType = static_cast<Converter::Types>(type); | ||
} | ||
|
||
Converter::Types Russifier::GetDefaultType() | ||
{ | ||
return gDefaultType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
About: rustext russifier | ||
Author: ziggi | ||
*/ | ||
|
||
#ifndef RUSSIFIER_H | ||
#define RUSSIFIER_H | ||
|
||
#include <map> | ||
#include "converter.hpp" | ||
|
||
class Russifier | ||
{ | ||
public: | ||
static void SetPlayerType(int playerid, Converter::Types type); | ||
static void SetPlayerType(int playerid, int type); | ||
static Converter::Types GetPlayerType(int playerid); | ||
|
||
static void SetDefaultType(Converter::Types type); | ||
static void SetDefaultType(int type); | ||
static Converter::Types GetDefaultType(); | ||
|
||
private: | ||
static std::map <int, Converter::Types> gPlayerTypesMap; | ||
static Converter::Types gDefaultType; | ||
}; | ||
|
||
#endif |