From 9123fa74d3e4e342a2581abbc126ec5624521de3 Mon Sep 17 00:00:00 2001 From: Richard Fine Date: Mon, 26 Aug 2019 18:50:37 +0100 Subject: [PATCH] Add ALL_DIRECTIONS array --- src/openrct2/world/Location.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 99cfbce164..2e78283227 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -269,6 +269,11 @@ typedef uint8_t Direction; const Direction INVALID_DIRECTION = 0xFF; +/** + * Array of all valid cardinal directions, to make it easy to write range-based for loops like: for (Direction d : ALL_DIRECTIONS) + */ +constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; + /** * Given a direction, return the direction that points the other way, * on the same axis.