#pragma once #include "MapAppAPIWrapper.hpp" #include #include #include #include #include class Junction; class Map { public: Map(std::istream &is, const std::string &windowTitle); void simulate(std::chrono::seconds duration, double speedFactor, double frequency); private: double time; std::vector> junctions; MapAppAPIWrapper mapApp; std::weak_ptr getJunction(const std::string &name); /// Required format: /// `name` `fuelAmount` `x` `y` void extractJunctionAndDraw(std::istream &is, MapAppAPIWrapper &mapApp); /// Required format: /// `nameJunctionA` `nameJunctionB` `nameLaneAToB` `nameLaneBToA` `length in km` /// `speedLimit in {1,2,3}` `noPassing` `coordinateCount` `coordinates...` void extractRoadAndDraw(std::istream &is, MapAppAPIWrapper &mapApp); /// Required format: /// `name` `topSpeed` `nameStartJunction` `timeOfStart` void extractBicycle(std::istream &is); /// Required format: /// `name` `topSpeed` `fuelConsumption` `fuelCapacity` `nameStartJunction` /// `timeOfStart` void extractCar(std::istream &is); };