[TileSet] Expose `TileData.is_valid_terrain_peering_bit`

This commit is contained in:
A Thousand Ships 2024-03-26 16:07:38 +01:00
parent 7d151c8381
commit d4fcca4545
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
2 changed files with 10 additions and 2 deletions

View File

@ -93,7 +93,7 @@
<return type="int" />
<param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
<description>
Returns the tile's terrain bit for the given [param peering_bit] direction.
Returns the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
</description>
</method>
<method name="is_collision_polygon_one_way" qualifiers="const">
@ -104,6 +104,13 @@
Returns whether one-way collisions are enabled for the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
</description>
</method>
<method name="is_valid_terrain_peering_bit" qualifiers="const">
<return type="bool" />
<param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
<description>
Returns whether the given [param peering_bit] direction is valid for this tile.
</description>
</method>
<method name="remove_collision_polygon">
<return type="void" />
<param index="0" name="layer_id" type="int" />
@ -200,7 +207,7 @@
<param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
<param index="1" name="terrain" type="int" />
<description>
Sets the tile's terrain bit for the given [param peering_bit] direction.
Sets the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
</description>
</method>
</methods>

View File

@ -6918,6 +6918,7 @@ void TileData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terrain"), &TileData::get_terrain);
ClassDB::bind_method(D_METHOD("set_terrain_peering_bit", "peering_bit", "terrain"), &TileData::set_terrain_peering_bit);
ClassDB::bind_method(D_METHOD("get_terrain_peering_bit", "peering_bit"), &TileData::get_terrain_peering_bit);
ClassDB::bind_method(D_METHOD("is_valid_terrain_peering_bit", "peering_bit"), &TileData::is_valid_terrain_peering_bit);
// Navigation
ClassDB::bind_method(D_METHOD("set_navigation_polygon", "layer_id", "navigation_polygon"), &TileData::set_navigation_polygon);