-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtContext.cpp
More file actions
32 lines (29 loc) · 1.19 KB
/
Copy pathExtContext.cpp
File metadata and controls
32 lines (29 loc) · 1.19 KB
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
//
// Created by dragoon on 4/7/18.
//
#include "ExtContext.h"
ExtContext::ExtContext(int tickIndex) : Context(tickIndex),
simTicks(std::list<int>()),
turnTime(std::list<int>()),
totalTicks(0),
totalTurnTime(0),
lastSimCount(0),
totalLength(0L),
tlPrevention(0L),
disableAddPoints(false),
ttf(std::map<std::pair<int, int>, int>()),
suspicious(std::set<std::pair<int, int>>()),
nextStepSuspicious(std::set<std::pair<int, int>>()) {
}
void ExtContext::updateTtfTick() {
std::swap(this->nextStepSuspicious, this->suspicious);
this->nextStepSuspicious.clear();
for (auto iter = ttf.begin(); iter != ttf.end();) {
if (iter->second == 1) {
iter = ttf.erase(iter);
} else {
--iter->second;
++iter;
}
}
}