-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathActionData.cpp
64 lines (52 loc) · 1.13 KB
/
ActionData.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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;
}