Merge pull request #89911 from AThousandShips/peering_bit

[TileSet] Expose `TileData.is_valid_terrain_peering_bit`
This commit is contained in:
Rémi Verschelde 2024-03-28 10:47:18 +01:00
commit 4e4bc3b39a
No known key found for this signature in database
GPG key ID: C3336907360768E1
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);