16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 21:29:18 +02:00
Files
maszyna/widgets/map_objects.h
2019-03-06 00:58:12 +01:00

41 lines
936 B
C++

#pragma once
#include "simulation.h"
#include "Event.h"
#include "scene.h"
namespace map {
struct map_object {
std::string name;
glm::vec3 location;
virtual ~map_object() = default;
};
using object_list = std::vector<std::shared_ptr<map::map_object>>;
using sorted_object_list = std::map<float, std::shared_ptr<map::map_object>>;
// semaphore description (only for minimap purposes)
struct semaphore : public map_object {
std::vector<TAnimModel *> models;
std::vector<basic_event *> events;
};
// switch description (only for minimap purposes)
struct track_switch : public map_object {
basic_event *straight_event = nullptr;
basic_event *divert_event = nullptr;
};
struct objects {
std::vector<std::shared_ptr<map_object>> entries;
// returns objects in range from vec3, NaN in Y ignores it
sorted_object_list find_in_range(glm::vec3 from, float distance);
};
extern objects Objects;
}