Sync to changes in the data structure definitions.
parent
b4a8bcd8d0
commit
02e43428ee
@ -1,26 +1,21 @@
|
|||||||
inline bool getassignment( const df::coord2d &xy )
|
inline bool getassignment( const df::coord2d &xy )
|
||||||
{
|
{
|
||||||
return getassignment(xy.x,xy.y);
|
return tile_bitmask.getassignment(xy);
|
||||||
}
|
}
|
||||||
inline bool getassignment( int x, int y )
|
inline bool getassignment( int x, int y )
|
||||||
{
|
{
|
||||||
return (tile_bitmask[y] & (1 << x));
|
return tile_bitmask.getassignment(x,y);
|
||||||
}
|
}
|
||||||
inline void setassignment( const df::coord2d &xy, bool bit )
|
inline void setassignment( const df::coord2d &xy, bool bit )
|
||||||
{
|
{
|
||||||
return setassignment(xy.x,xy.y, bit);
|
return tile_bitmask.setassignment(xy, bit);
|
||||||
}
|
}
|
||||||
inline void setassignment( int x, int y, bool bit )
|
inline void setassignment( int x, int y, bool bit )
|
||||||
{
|
{
|
||||||
if(bit)
|
return tile_bitmask.setassignment(x, y, bit);
|
||||||
tile_bitmask[y] |= (1 << x);
|
|
||||||
else
|
|
||||||
tile_bitmask[y] &= ~(1 << x);
|
|
||||||
}
|
}
|
||||||
bool has_assignments()
|
bool has_assignments()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 16; i++)
|
return tile_bitmask.has_assignments();
|
||||||
if (tile_bitmask[i])
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,26 +1,20 @@
|
|||||||
inline bool getassignment( const df::coord2d &xy )
|
inline bool getassignment( const df::coord2d &xy )
|
||||||
{
|
{
|
||||||
return getassignment(xy.x,xy.y);
|
return tile_bitmask.getassignment(xy);
|
||||||
}
|
}
|
||||||
inline bool getassignment( int x, int y )
|
inline bool getassignment( int x, int y )
|
||||||
{
|
{
|
||||||
return (tile_bitmask[y] & (1 << x));
|
return tile_bitmask.getassignment(x,y);
|
||||||
}
|
}
|
||||||
inline void setassignment( const df::coord2d &xy, bool bit )
|
inline void setassignment( const df::coord2d &xy, bool bit )
|
||||||
{
|
{
|
||||||
return setassignment(xy.x,xy.y, bit);
|
return tile_bitmask.setassignment(xy, bit);
|
||||||
}
|
}
|
||||||
inline void setassignment( int x, int y, bool bit )
|
inline void setassignment( int x, int y, bool bit )
|
||||||
{
|
{
|
||||||
if(bit)
|
return tile_bitmask.setassignment(x, y, bit);
|
||||||
tile_bitmask[y] |= (1 << x);
|
|
||||||
else
|
|
||||||
tile_bitmask[y] &= ~(1 << x);
|
|
||||||
}
|
}
|
||||||
bool has_assignments()
|
bool has_assignments()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 16; i++)
|
return tile_bitmask.has_assignments();
|
||||||
if (tile_bitmask[i])
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
inline uint16_t &operator[] (int y)
|
||||||
|
{
|
||||||
|
return bits[y];
|
||||||
|
}
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
memset(bits,0,sizeof(bits));
|
||||||
|
}
|
||||||
|
void set_all()
|
||||||
|
{
|
||||||
|
memset(bits,0xFF,sizeof(bits));
|
||||||
|
}
|
||||||
|
inline bool getassignment( const df::coord2d &xy )
|
||||||
|
{
|
||||||
|
return getassignment(xy.x,xy.y);
|
||||||
|
}
|
||||||
|
inline bool getassignment( int x, int y )
|
||||||
|
{
|
||||||
|
return (bits[y] & (1 << x));
|
||||||
|
}
|
||||||
|
inline void setassignment( const df::coord2d &xy, bool bit )
|
||||||
|
{
|
||||||
|
return setassignment(xy.x,xy.y, bit);
|
||||||
|
}
|
||||||
|
inline void setassignment( int x, int y, bool bit )
|
||||||
|
{
|
||||||
|
if(bit)
|
||||||
|
bits[y] |= (1 << x);
|
||||||
|
else
|
||||||
|
bits[y] &= ~(1 << x);
|
||||||
|
}
|
||||||
|
bool has_assignments()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
if (bits[i])
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
Subproject commit e8036d3f13c6be0141899baae90f605ad11d5385
|
Subproject commit a1e342afe5a5e1e07672cd8b6553953bc251a05d
|
Loading…
Reference in New Issue