9 #include "../../clib/rawtypes.h" 10 #include "../../plib/systemstate.h" 49 0x35D4, 0x35D3, 0x35D6,
51 0x360B, 0x360A, 0x360D,
53 0x4360, 0x435E, 0x435F,
55 0x435C, 0x435A, 0x435B,
57 0x4364, 0x4362, 0x4363,
66 for (
unsigned int i = 0; delta < 0 && ( i < (
sizeof BlockIDs ) / (
sizeof(
int ) ) ); ++i )
67 delta = ( BlockIDs[i] -
id );
69 return ( delta == 0 );
77 for (
unsigned int i = 0; delta < -3 && ( i < (
sizeof StairSeqs ) / (
sizeof(
int ) ) ); ++i )
78 delta = ( StairSeqs[i] -
id );
80 if ( delta >= -3 && delta <= 0 )
88 for (
unsigned int i = 0; delta < 0 && ( i < (
sizeof StairIDs ) / (
sizeof(
int ) ) ); ++i )
90 delta = ( StairIDs[i] - id );
94 return ( delta == 0 );
100 if ( floor_num == -1 )
110 for ( HouseFloorZColumn::iterator itr =
Elements[floor_num].
data.at( xidx ).at( yidx ).begin(),
111 itrend =
Elements[floor_num].
data.at( xidx ).at( yidx ).end();
112 itr != itrend; ++itr )
114 if ( itr->z == ( z + 5 ) )
129 int erase_height = ( ( z - 7 ) % 20 ) / 5;
140 yStart = y + erase_height;
147 xStart = x + erase_height;
156 yStart = y - erase_height;
163 xStart = x - erase_height;
171 int zStart = z - ( erase_height * 5 );
173 for (
int i = 0; i < 4; ++i )
175 x = xStart + ( i * xInc );
176 y = yStart + ( i * yInc );
178 for (
int j = 0; j <= i; ++j )
179 Erase( x, y, static_cast<u8>( zStart + ( j * 5 ) ), 2 );
202 for (
size_t i = 0; i <
width; i++ )
216 for (
const auto& floor :
data )
218 size += 3 *
sizeof( std::list<CUSTOM_HOUSE_ELEMENT>* ) +
219 floor.capacity() *
sizeof( std::list<CUSTOM_HOUSE_ELEMENT> );
220 for (
const auto& l : floor )
232 return &(
data.at( x ).at( y ) );
239 data.at( x ).at( y ).push_back( elem );
void SetWidth(u32 _width)
std::list< CUSTOM_HOUSE_ELEMENT > HouseFloorZColumn
static bool IsStair(u16 id, int &dir)
void SetHeight(u32 _height)
bool ValidLocation(u32 xidx, u32 yidx)
std::vector< std::vector< std::list< CUSTOM_HOUSE_ELEMENT > > > HouseFloor
HouseFloorZColumn * GetElementsAt(s32 xoffset, s32 yoffset)
size_t estimatedSize() const
void AddElement(CUSTOM_HOUSE_ELEMENT &elem)
static char z_to_custom_house_table(char z)
void ReplaceDirtFloor(u32 x, u32 y)
static bool IsStairBlock(u16 id)
bool DeleteStairs(u16 id, s32 x, s32 y, s8 z)
std::unordered_map< u64, ScriptDiffData > data
CustomHouseElements Elements[CUSTOM_HOUSE_NUM_PLANES]
bool Erase(u32 xoffset, u32 yoffset, u8 z, int minheight=0)