15 #include "../../bscript/bstruct.h" 16 #include "../../clib/cfgelem.h" 17 #include "../../clib/cfgfile.h" 18 #include "../../clib/passert.h" 19 #include "../../clib/strutil.h" 20 #include "../globals/multidefs.h" 49 ") not found in boats.cfg" );
52 else if ( elem.
type_is(
"HOUSE" ) )
56 else if ( elem.
type_is(
"STAIRS" ) )
64 std::istringstream is( tmp );
67 if ( is >> std::hex >> multielem.
objtype >> std::dec >> multielem.
x >> multielem.
y >>
70 elems.push_back( multielem );
74 std::string message =
"Badly formed static directive: '" + tmp +
"'";
80 std::istringstream is( tmp );
83 if ( is >> std::hex >> multielem.
objtype >> std::dec >> multielem.
x >> multielem.
y >>
86 elems.push_back( multielem );
90 std::string message =
"Badly formed dynamic directive: '" + tmp +
"'";
99 short rx,
short ry )
const 128 unsigned short k =
getkey( elem->
x, elem->
y );
130 if ( !
hull2.count( k ) )
132 hull.push_back( elem );
139 short int_rx = elem->
x, int_ry = elem->
y;
144 else if ( elem->
x ==
maxrx )
151 else if ( elem->
y > 0 )
162 unsigned short k =
getkey( elem->
x, elem->
y );
179 if ( elem !=
nullptr )
189 if ( elem !=
nullptr )
204 if ( elem !=
nullptr )
213 if ( elem !=
nullptr )
263 for (
unsigned i = 0; i <
elems.size(); i++ )
277 size += 3 *
sizeof(
void* ) +
hull2.size() * (
sizeof(
unsigned short ) + 3 *
sizeof(
void* ) );
278 size += 3 *
sizeof(
void* ) +
279 internal_hull2.size() * (
sizeof(
unsigned short ) + 3 *
sizeof(
void* ) );
281 size += (
sizeof(
unsigned short ) +
sizeof(
MULTI_ELEM* ) + (
sizeof(
void* ) * 3 + 1 ) / 2 ) *
303 return ( *citr ).second;
313 while ( cf.
read( elem ) )
MultiDefs multidefs_by_multiid
void add_to_internal_hull(const MULTI_ELEM *elem)
static short global_maxry
size_t estimateSize() const
void add_to_hull(const MULTI_ELEM *elem)
bool BoatShapeExists(u16 multiid)
ItrPair findcomponents(short rx, short ry)
const MULTI_ELEM * find_component(short rx, short ry) const
static short global_maxrx
static unsigned short getkey(short rx, short ry)
void addrec(const MULTI_ELEM *elem)
std::string hexint(unsigned short v)
const char * rest() const
static short global_maxrz
POL_NORETURN void throw_error(const std::string &errmsg) const
std::pair< Components::const_iterator, Components::const_iterator > ItrPair
std::vector< MULTI_ELEM > elems
static short global_minrz
bool remove_prop(const char *propname, std::string *value)
MultiDef(Clib::ConfigElem &elem, u16 multiid)
bool MultiDefByMultiIDExists(u16 multiid)
bool type_is(const char *name) const
static short global_minrx
static short global_minry
bool read(ConfigElem &elem)
enum Pol::Multi::MultiDef::HOUSETYPE type
MultiDefBuffer multidef_buffer
const MultiDef * MultiDefByMultiID(u16 multiid)
bool body_contains(short rx, short ry) const