Skip to content

Commit 05431cd

Browse files
committed
progression tries source
1 parent eb5c397 commit 05431cd

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#pragma once
2+
3+
#include "GameAnalytics/GAProgressionTries.h"
4+
5+
namespace gameanalytics
6+
{
7+
void ProgressionTries::setTries(std::string const& s, int tries)
8+
{
9+
_tries[s] = tries;
10+
}
11+
12+
void ProgressionTries::remove(std::string const& s)
13+
{
14+
if (_tries.count(s))
15+
{
16+
_tries.erase(s);
17+
}
18+
}
19+
20+
int ProgressionTries::getTries(std::string const& s) const
21+
{
22+
return _tries.count(s) ? _tries.at(s) : 0;
23+
}
24+
25+
int ProgressionTries::incrementTries(std::string const& s)
26+
{
27+
if (_tries.count(s))
28+
{
29+
_tries[s]++;
30+
}
31+
else
32+
{
33+
_tries[s] = 1;
34+
}
35+
36+
return _tries[s];
37+
}
38+
}

0 commit comments

Comments
 (0)