Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/AI/ActionInterface/AITeam.cpp

Diff revisions: vs.
  @@ -17,18 +17,18 @@
17 17
18 18 AITeam::~AITeam()
19 19 {
20 - AIManager::getInstance().unregisterTeam(this);
21 - {
22 - WriteLock w1_lock(_crowdMutex);
20 + AIManager::getInstance().unregisterTeam(this);
21 + {
22 + WriteLock w1_lock(_crowdMutex);
23 23 MemoryManager::DELETE_HASHMAP(_aiTeamCrowd);
24 - }
25 - {
26 - WriteLock w2_lock(_updateMutex);
27 - for (AITeam::TeamMap::value_type& entity : _team) {
28 - entity.second->setTeamPtr(nullptr);
29 - }
30 - _team.clear();
31 - }
24 + }
25 + {
26 + WriteLock w2_lock(_updateMutex);
27 + for (AITeam::TeamMap::value_type& entity : _team) {
28 + entity.second->setTeamPtr(nullptr);
29 + }
30 + _team.clear();
31 + }
32 32
33 33 }
34 34
  @@ -49,40 +49,40 @@
49 49 void AITeam::update(const U64 deltaTime) {
50 50 // Crowds
51 51 ReadLock r_lock(_crowdMutex);
52 - for (AITeamCrowd::value_type& it : _aiTeamCrowd) {
52 + for (AITeamCrowd::value_type& it : _aiTeamCrowd) {
53 53 it.second->update( deltaTime );
54 54 }
55 55 r_lock.unlock();
56 56 WriteLock w_lock(_updateMutex);
57 - for (AITeam::TeamMap::value_type& entity : _team) {
57 + for (AITeam::TeamMap::value_type& entity : _team) {
58 58 entity.second->update( deltaTime );
59 59 }
60 60 }
61 61
62 62 void AITeam::processInput(const U64 deltaTime) {
63 63 WriteLock w_lock(_updateMutex);
64 - for (AITeam::TeamMap::value_type& entity : _team) {
64 + for (AITeam::TeamMap::value_type& entity : _team) {
65 65 entity.second->processInput( deltaTime );
66 66 }
67 67 }
68 68
69 69 void AITeam::processData(const U64 deltaTime){
70 70 WriteLock w_lock(_updateMutex);
71 - for (AITeam::TeamMap::value_type& entity : _team) {
71 + for (AITeam::TeamMap::value_type& entity : _team) {
72 72 entity.second->processData( deltaTime );
73 73 }
74 74 }
75 75
76 76 void AITeam::init() {
77 77 WriteLock w_lock(_updateMutex);
78 - for (AITeam::TeamMap::value_type& entity : _team) {
78 + for (AITeam::TeamMap::value_type& entity : _team) {
79 79 entity.second->init();
80 80 }
81 81 }
82 82
83 83 void AITeam::resetCrowd() {
84 84 WriteLock w_lock(_updateMutex);
85 - for (AITeam::TeamMap::value_type& entity : _team) {
85 + for (AITeam::TeamMap::value_type& entity : _team) {
86 86 entity.second->resetCrowd();
87 87 }
88 88 }