feat: Migrating features from newer implementation
This commit is contained in:
@@ -21,149 +21,73 @@ class SPITPlayer {
|
||||
|
||||
//----- PlayObject used in PlaySequences: PlaySPITStart, PlaySPITObject,..., PlaySPITEnd ------
|
||||
public:
|
||||
class PlayObject {
|
||||
class PlaySPITType {
|
||||
public:
|
||||
PlayObject();
|
||||
PlayObject(SPITPlayer* p_SPITPlayer, string p_SPITObjectID);
|
||||
PlayObject(const PlayObject& orig);
|
||||
PlaySPITType();
|
||||
PlaySPITType(SPITPlayer* p_SPITPlayer, string p_SPITObjectID);
|
||||
PlaySPITType(const PlaySPITType& orig);
|
||||
|
||||
string getSPITObjectID() const {
|
||||
return m_SPITObjectID;
|
||||
string getSPITTypeID() const {
|
||||
return m_SPITTypeID;
|
||||
}
|
||||
|
||||
void startPlaySequence();
|
||||
bool getIsNew() const {
|
||||
return m_IsNew;
|
||||
}
|
||||
void setIsNew(bool p_IsNew) {
|
||||
m_IsNew = p_IsNew;
|
||||
}
|
||||
bool getIsPlayed() const {
|
||||
return m_IsPlayed;
|
||||
}
|
||||
void setIsPlayed(bool p_IsFound) {
|
||||
m_IsPlayed = p_IsFound;
|
||||
}
|
||||
|
||||
|
||||
string getPlayerID() const {
|
||||
return m_PlayerID;
|
||||
}
|
||||
string getPlayerName() const {
|
||||
return m_PlayerName;
|
||||
}
|
||||
bool getPlayerIsRunning() const {
|
||||
return m_PlayerRuns;
|
||||
}
|
||||
void setPlayerIsRunning(bool p_PlayerRuns) {
|
||||
m_PlayerRuns = p_PlayerRuns;
|
||||
}
|
||||
|
||||
void setValue(int p_Value, bool p_PlayPrePosition) {
|
||||
if (p_PlayPrePosition) m_ValuePrePosition = p_Value;
|
||||
else m_Value = p_Value;
|
||||
}
|
||||
|
||||
int getValue() const {
|
||||
return m_ValuePrePosition + m_Value;
|
||||
}
|
||||
int getValueFadePrePosition() const {
|
||||
return m_ValuePrePosition;
|
||||
}
|
||||
int getValueFade() const {
|
||||
return m_Value;
|
||||
}
|
||||
void setValueFactor(int p_ValueFactor) {
|
||||
m_ValueFactor = p_ValueFactor;
|
||||
}
|
||||
void setValueFlag(char p_ValueFlag) {
|
||||
m_ValueFlag = p_ValueFlag;
|
||||
}
|
||||
int getValueFactor() const {
|
||||
return m_ValueFactor;
|
||||
}
|
||||
char getValueFlag() const {
|
||||
return m_ValueFlag;
|
||||
}
|
||||
void setFrameInside(long long p_FrameInside, bool p_PlayPrePosition) {
|
||||
if (p_PlayPrePosition) m_FrameInsidePrePosition = p_FrameInside;
|
||||
else m_FrameInside = p_FrameInside;
|
||||
}
|
||||
long long getFrameInside() const {
|
||||
return m_FrameInside;
|
||||
}
|
||||
long long getFrameInsidePrePosition() const {
|
||||
return m_FrameInsidePrePosition;
|
||||
}
|
||||
|
||||
|
||||
bool getIsNew() const { return m_IsNew; }
|
||||
void setIsNew(bool p_IsNew) { m_IsNew = p_IsNew; }
|
||||
bool getIsPlayed() const { return m_IsPlayed; }
|
||||
void setIsPlayed(bool p_IsFound) { m_IsPlayed = p_IsFound; }
|
||||
string getPlayerID() const { return m_PlayerID; }
|
||||
string getPlayerName() const { return m_PlayerName; }
|
||||
bool getPlayerIsRunning() const { return m_PlayerRuns; }
|
||||
void setPlayerIsRunning(bool p_PlayerRuns) { m_PlayerRuns = p_PlayerRuns; }
|
||||
void setValue(double p_Value) { m_Value = p_Value; }
|
||||
void addValue(double p_Value, double p_ValueFactor) { m_Value += (p_Value * p_ValueFactor); }
|
||||
double getValue() const { return m_Value; }
|
||||
|
||||
private:
|
||||
string m_PlayerID;
|
||||
string m_PlayerName;
|
||||
bool m_PlayerRuns;
|
||||
string m_SPITObjectID;
|
||||
string m_SPITTypeID;
|
||||
bool m_IsPlayed;
|
||||
bool m_IsNew;
|
||||
|
||||
int m_Value;
|
||||
int m_ValuePrePosition;
|
||||
int m_ValueFactor;
|
||||
char m_ValueFlag;
|
||||
long long m_FrameInsidePrePosition;
|
||||
long long m_FrameInside;
|
||||
|
||||
|
||||
double m_Value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//----- SPITPlayer ------
|
||||
public:
|
||||
//list the SPITPlayers
|
||||
static unordered_map<string, SPITPlayer*> s_SPITPlayers; //all actual played objects
|
||||
static SPITPlayer* getSPITPlayer(string p_PlayerID); //if a player does not exist creates a new one
|
||||
static void clearPlayers();
|
||||
|
||||
|
||||
|
||||
|
||||
SPITPlayer(string p_PlayerID);
|
||||
virtual ~SPITPlayer();
|
||||
|
||||
|
||||
void startPlaySequence(); //called by SPIT_Client::parsePlaySPITStart
|
||||
PlayObject* addSPITObject_Playing (string p_SPITObjectID); //called by SPIT_Client::parsePlaySPITStart
|
||||
PlaySPITType* addSPITType_Playing (string p_SPITTypeID); //called by SPIT_Client::parsePlaySPITStart
|
||||
void endPlaySequence(); //called by SPIT_Client::parsePlaySPITEnd
|
||||
|
||||
string getID() {
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
unordered_map<string, PlayObject*>* getPlayObjects();
|
||||
|
||||
unordered_map<string, PlaySPITType*>* getPlaySPITTypes();
|
||||
void setIsRunning(bool p_IsRunning);
|
||||
bool getIsRunning() {
|
||||
return m_IsRunning;
|
||||
}
|
||||
void setName(string p_Name);
|
||||
string getName() {
|
||||
return m_Name;
|
||||
}
|
||||
bool getIsRunning() { return m_IsRunning; }
|
||||
void setName(string p_Name);
|
||||
string getName() { return m_Name; }
|
||||
void setType(char p_Type);
|
||||
char getType() {
|
||||
return m_Type;
|
||||
}
|
||||
char getType() { return m_Type; }
|
||||
void setTime(long long p_Frames);
|
||||
long long getTime() {
|
||||
return m_TimeFrames;
|
||||
}
|
||||
|
||||
PlayObject* getPlayObject(string p_SPITObjectID);
|
||||
|
||||
long long getTime() { return m_TimeFrames; }
|
||||
|
||||
private:
|
||||
string m_ID;
|
||||
string m_Name;
|
||||
char m_Type;
|
||||
unordered_map<string, PlayObject*> m_PlayObjects;
|
||||
unordered_map<string, PlaySPITType*> m_PlaySPITTypes;
|
||||
bool m_IsRunning;
|
||||
long long m_TimeFrames;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user