/* * area.hpp * BoE * * Created by Celtic Minstrel on 02/09/16. * */ #ifndef BOE_DATA_AREA_HPP #define BOE_DATA_AREA_HPP #include #include #include #include "global.hpp" #include "vector2d.hpp" #include "location.hpp" #include "special.hpp" #include "mathutil.hpp" enum { AREA_TINY = 24, AREA_SMALL = 32, AREA_MEDIUM = 48, AREA_LARGE = 64, AREA_HUGE = 128, }; class cArea { public: const size_t max_dim; vector2d terrain; std::vector special_locs; std::vector sign_locs; std::vector area_desc; std::vector specials; std::string name; // Persistent data for saved games std::vector> maps; explicit cArea(size_t dim) : max_dim(dim) , terrain(dim, dim) , maps(dim, boost::dynamic_bitset<>(dim)) {} bool is_on_map(location const &loc) const { return loc.x < max_dim && loc.y < max_dim && loc.x >= 0 && loc.y >= 0; } bool is_on_map(short x, short y) const { return x < max_dim && y < max_dim && x >= 0 && y >= 0; } info_rect_t const &get_area_desc(int num) const; info_rect_t &get_area_desc(int num); sign_loc_t const &get_sign_loc(int num) const; sign_loc_t &get_sign_loc(int num); cSpecial const &get_special(int num) const; cSpecial &get_special(int num); }; #endif