+Trigger *Map::TriggerAt(const geometry::Vector<int> &offset) {
+ // TODO: add support for multiple triggers on a tile?
+ Vector<int> coords(TileCoordinates(offset));
+ for (Trigger *i(triggers); i != triggers + numTriggers; ++i) {
+ if (i->TilePosition() == coords) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+Vector<int> Map::TileCoordinates(const Vector<int> &position) const {
+ return position / tileset->Size();
+}
+