Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
433 stars 21 forks source link

C# Question #90

Closed IrishBruse closed 1 month ago

IrishBruse commented 1 month ago

Is there a reason the c# wrapper uses a class when it could match the godot version of being a static class that takes in the tilemap layer?

C# can do static functions like godot with

public static void Foo() {...}

so it could be like BetterTerrain.SetTerrain(tilemaplayer,index)

that way both apis could be identical are you open to a pr i could update the c# wrapper to match the godot version?

Portponky commented 1 month ago

The main reason is I'm not very good at C# and not really a fan of it. Other contributors have really improved the quality of the C# wrapper. There's already a C++ version of Better Terrain (https://github.com/Portponky/better-terrain-gde), which needs updated, and it's time consuming to have multiple distinct versions of the code.

It would be a big boon for C# users to have a way of using a C# version of Better Terrain from code - the C++ version is way faster than the built-in terrain system, and a C# version should be comparable. It can't be triggered through the exact same api, as then it would clash with the gdscript version. That's why the wrapper is designed the way it is, to operate on a specific TileMap from code.

I'd be open to a PR that implements the terrain algorithm in C#. It would have to fit with the current code and work from the non-C# version of Godot seamlessly. It would also have to target the 4.3 branch tile-map-layers which uses TileMapLayer nodes, as the 4.2 version is only getting bugfixes now. I'm sure there would be a lot of people who would be very grateful.

Of course if you want to make something like a full C# port, which would not be compatible, you are free to do that as Better Terrain is completely public domain. See the license file for details.