Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions src/simulator/AirController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,16 @@
#include <list>
#include <fstream>

namespace atcsim{
namespace atcsim {

AirController::AirController() {
// TODO Auto-generated constructor stub

// TODO(my_username): Auto-generated constructor stub
}

AirController::~AirController() {
// TODO Auto-generated destructor stub
// TODO(my_username): Auto-generated destructor stub
}

void
AirController::doWork()
{
AirController::doWork() {
std::list<Flight*> flights = Airport::getInstance()->getFlights();
std::list<Flight*>::iterator it;

Expand All @@ -62,16 +58,12 @@ AirController::doWork()
r3.pos = pos3;
r3.speed = 15.0;

for(it = flights.begin(); it!=flights.end(); ++it)
{
if((*it)->getRoute()->empty())
{
for(it = flights.begin(); it != flights.end(); ++it) {
if ((*it)->getRoute()->empty()) {
(*it)->getRoute()->push_back(r3);
(*it)->getRoute()->push_front(r2);
(*it)->getRoute()->push_front(r1);
(*it)->getRoute()->push_front(r0);
}
}
(*it)->getRoute()->push_front(r0);}
}
}

} // namespace atcsim
14 changes: 7 additions & 7 deletions src/simulator/AirController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
* along with ATCSim. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef AIRCONTROLLER_H_
#define AIRCONTROLLER_H_
#ifndef SRC_SIMULATOR_AIRCONTROLLER_H_
#define SRC_SIMULATOR_AIRCONTROLLER_H_

#include "Singleton.h"

namespace atcsim{

class AirController: public Singleton<AirController> {
public:
AirController();
virtual ~AirController();
public:
AirController();
virtual ~AirController();

void doWork();
void doWork();
};

}; // namespace atcsim

#endif /* AIRCONTROLLER_H_ */
#endif // SRC_SIMULATOR_AIRCONTROLLER_H_
Loading