-
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
242 changed files
with
62,755 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// wxWindows includes | ||
#include <wx/string.h> | ||
#include <wx/arrstr.h> | ||
#include <wx/dynarray.h> | ||
|
||
// Statsgen includes | ||
#include "AKAListEntry.h" | ||
#include "GlobalStatistics.h" | ||
|
||
AKAListEntry::AKAListEntry() | ||
{ | ||
} | ||
|
||
AKAListEntry::~AKAListEntry() | ||
{ | ||
} | ||
|
||
wxString AKAListEntry::SQLTableName() | ||
{ | ||
wxString tableName="akadata"; | ||
|
||
return (tableName); | ||
} | ||
|
||
wxString AKAListEntry::SQLCreateTable() | ||
{ | ||
wxString SQL; | ||
|
||
SQL.Printf("create table %s" | ||
"(" | ||
"playerindex integer," | ||
"%s" | ||
")", | ||
SQLTableName().GetData(), | ||
StatsgenDatabase::StringFieldDefinition("name","akaname",FIELD_WIDTH_PLAYER_NAME).GetData() | ||
); | ||
|
||
return SQL; | ||
} | ||
|
||
bool AKAListEntry::WriteToDatabase() | ||
{ | ||
wxString SQL; | ||
bool retVal=true; | ||
int actualPlayerIndex; | ||
Player player; | ||
|
||
player=globalStatistics.playerList.Item(playerIndex); | ||
actualPlayerIndex=player.actualPlayerIndex; | ||
|
||
if (actualPlayerIndex<globalStatistics.statsgenDatabase.NextPlayerIndex()) | ||
{ | ||
SQL.Printf("delete from %s " | ||
"where " | ||
"playerindex='%d' and " | ||
"name='%s'", | ||
SQLTableName().GetData(), | ||
actualPlayerIndex, | ||
StatsgenDatabase::SafeForInsert(name).GetData()); | ||
globalStatistics.statsgenDatabase.SimpleExecute(SQL); | ||
|
||
} | ||
SQL.Printf("Insert into %s" | ||
"(playerindex,name)" | ||
"values('%d','%s')", | ||
SQLTableName().GetData(), | ||
actualPlayerIndex, | ||
StatsgenDatabase::SafeForInsert(name).GetData()); | ||
|
||
globalStatistics.statsgenDatabase.SimpleExecute(SQL); | ||
return retVal; | ||
} |
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,29 @@ | ||
#ifndef __AKALISTENTRY | ||
#define __AKALISTENTRY | ||
|
||
// wxWindows includes | ||
#include <wx/datetime.h> | ||
#include <wx/string.h> | ||
#include <wx/dynarray.h> | ||
#include <wx/textfile.h> | ||
|
||
// Statsgen Includes | ||
|
||
class AKAListEntry; | ||
|
||
WX_DECLARE_OBJARRAY(AKAListEntry,ArrayOfAKAListEntry); | ||
class AKAListEntry | ||
{ | ||
public: | ||
AKAListEntry(); | ||
~AKAListEntry(); | ||
int playerIndex; | ||
wxString name; | ||
|
||
static wxString SQLCreateTable(); | ||
static wxString SQLTableName(); | ||
bool WriteToDatabase(); | ||
}; | ||
|
||
|
||
#endif |
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,64 @@ | ||
// wxWindows includes | ||
#include <wx/string.h> | ||
#include <wx/arrstr.h> | ||
#include <wx/dynarray.h> | ||
|
||
// Statsgen includes | ||
#include "ActionData.h" | ||
#include "GlobalStatistics.h" | ||
|
||
ActionData::ActionData() | ||
{ | ||
} | ||
|
||
ActionData::~ActionData() | ||
{ | ||
} | ||
|
||
wxString ActionData::SQLTableName() | ||
{ | ||
wxString tableName="actiondata"; | ||
|
||
return (tableName); | ||
} | ||
|
||
wxString ActionData::SQLCreateTable() | ||
{ | ||
wxString SQL; | ||
|
||
SQL.Printf("create table %s" | ||
"(" | ||
"roundindex integer," | ||
"actionidx integer," | ||
"playerindex integer," | ||
"playerclass integer," | ||
"playerteam integer," | ||
"action integer" | ||
")", | ||
SQLTableName().GetData()); | ||
|
||
return SQL; | ||
} | ||
|
||
bool ActionData::WriteToDatabase(int roundIndex,int itemIndex) | ||
{ | ||
wxString SQL; | ||
bool retVal=true; | ||
Player player; | ||
|
||
player=globalStatistics.playerList.Item(playerIndex); | ||
|
||
SQL.Printf("Insert into %s" | ||
"(roundindex,actionidx,playerindex,playerclass,playerteam,action)" | ||
"values('%d','%d','%d','%d','%d','%d')", | ||
SQLTableName().GetData(), | ||
roundIndex, | ||
itemIndex, | ||
player.actualPlayerIndex, | ||
playerClass, | ||
playerTeam, | ||
action); | ||
|
||
globalStatistics.statsgenDatabase.SimpleExecute(SQL); | ||
return retVal; | ||
} |
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,34 @@ | ||
#ifndef __ACTIONDATA | ||
#define __ACTIONDATA | ||
|
||
// wxWindows includes | ||
#include <wx/datetime.h> | ||
#include <wx/string.h> | ||
#include <wx/dynarray.h> | ||
|
||
// Statsgen Includes | ||
|
||
class ActionData; | ||
|
||
WX_DECLARE_OBJARRAY(ActionData,ArrayOfActionData); | ||
class ActionData | ||
{ | ||
public: | ||
ActionData(); | ||
virtual ~ActionData(); | ||
static wxString SQLCreateTable(); | ||
static wxString SQLTableName(); | ||
bool WriteToDatabase(int roundIndex,int itemIndex); | ||
|
||
wxDateTime actionTime; | ||
int gameType; | ||
int mapName; | ||
int playerIndex; | ||
int playerClass; | ||
int playerTeam; | ||
int action; | ||
|
||
}; | ||
|
||
|
||
#endif |
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,23 @@ | ||
// wxWindows includes | ||
#include <wx/string.h> | ||
#include <wx/arrstr.h> | ||
|
||
// Statsgen includes | ||
#include "AliasCacheEntry.h" | ||
|
||
int AliasCacheEntry::Compare(AliasCacheEntry *item1,AliasCacheEntry *item2) | ||
{ | ||
int guidResult; | ||
int retVal; | ||
|
||
guidResult=item1->guid.Cmp(item2->guid); | ||
if (guidResult==0) | ||
{ | ||
retVal=item1->name.Cmp(item2->name); | ||
} | ||
else | ||
{ | ||
retVal=guidResult; | ||
} | ||
return (retVal); | ||
} |
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,23 @@ | ||
#ifndef __ALIASCACHEENTRY | ||
#define __ALIASCACHEENTRY | ||
|
||
// wxWindows includes | ||
#include <wx/datetime.h> | ||
#include <wx/string.h> | ||
#include <wx/arrstr.h> | ||
#include <wx/dynarray.h> | ||
|
||
class AliasCacheEntry; | ||
|
||
WX_DEFINE_SORTED_ARRAY(AliasCacheEntry *,ArrayOfAliasCacheEntry); | ||
class ArrayOfAliasCacheEntry; | ||
class AliasCacheEntry | ||
{ | ||
public: | ||
static int Compare(AliasCacheEntry *item1,AliasCacheEntry *item2); | ||
wxString name; | ||
wxString guid; | ||
int index; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.