Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 333 vs 337 for /trunk/Source Code/AI/PathFinding/Waypoints/WaypointGraph.cpp

Diff revisions: vs.
  @@ -5,40 +5,40 @@
5 5
6 6 namespace Divide {
7 7 namespace Navigation {
8 - WaypointGraph::WaypointGraph(){
9 - _id = 0xFFFFFFFF;
10 - _loop = true;
11 - }
8 + WaypointGraph::WaypointGraph(){
9 + _id = 0xFFFFFFFF;
10 + _loop = true;
11 + }
12 12
13 - WaypointGraph::~WaypointGraph(){
14 - _waypoints.clear();
15 - }
13 + WaypointGraph::~WaypointGraph(){
14 + _waypoints.clear();
15 + }
16 16
17 - void WaypointGraph::addWaypoint(Waypoint* wp){
18 - if(_waypoints.find(wp->getID()) != _waypoints.end()) return;
19 - hashAlg::emplace(_waypoints, wp->getID(), wp);
20 - updateGraph();
21 - }
17 + void WaypointGraph::addWaypoint(Waypoint* wp){
18 + if(_waypoints.find(wp->getID()) != _waypoints.end()) return;
19 + hashAlg::emplace(_waypoints, wp->getID(), wp);
20 + updateGraph();
21 + }
22 22
23 - void WaypointGraph::removeWaypoint(Waypoint* wp){
24 - if(_waypoints.find(wp->getID()) != _waypoints.end()){
25 - _waypoints.erase(wp->getID());
26 - updateGraph();
27 - }else{
28 - PRINT_FN(Locale::get("WARN_WAYPOINT_NOT_FOUND"),wp->getID(), getID());
29 - }
30 - }
23 + void WaypointGraph::removeWaypoint(Waypoint* wp){
24 + if(_waypoints.find(wp->getID()) != _waypoints.end()){
25 + _waypoints.erase(wp->getID());
26 + updateGraph();
27 + }else{
28 + PRINT_FN(Locale::get("WARN_WAYPOINT_NOT_FOUND"),wp->getID(), getID());
29 + }
30 + }
31 31
32 - void WaypointGraph::updateGraph(){
33 - typedef hashMapImpl<U32, Waypoint*> wp;
34 - _positions.clear();
35 - _rotations.clear();
36 - _times.clear();
37 - for (wp::value_type& waypoint : _waypoints){
38 - _positions.push_back((waypoint.second)->_position);
39 - _rotations.push_back((waypoint.second)->_orientation);
40 - _times.push_back((waypoint.second)->_time);
41 - }
42 - }
32 + void WaypointGraph::updateGraph(){
33 + typedef hashMapImpl<U32, Waypoint*> wp;
34 + _positions.clear();
35 + _rotations.clear();
36 + _times.clear();
37 + for (wp::value_type& waypoint : _waypoints){
38 + _positions.push_back((waypoint.second)->_position);
39 + _rotations.push_back((waypoint.second)->_orientation);
40 + _times.push_back((waypoint.second)->_time);
41 + }
42 + }
43 43 };
44 44 };