godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.89k stars 20.16k forks source link

Godot Mono - Can't implement abstract classes in c# #38355

Closed Peatral closed 4 years ago

Peatral commented 4 years ago

Godot version: Godot 3.2.1 Mono

OS/device including version: Windows 10

Issue description: Can't implement abstract classes in c#

Steps to reproduce:

  1. Pick an abstract class you want to make an implementation for (eg. NetworkedMultiplayerPeer)
  2. Make class that extends the abstract class
  3. Try to add a constructor
  4. Compile
  5. Compiler will always throw the error "<Baseclass>" enthält keinen Konstruktor der <x> Argumente annimmt. (The baseclass does not contain a constructor that takes x arguments.)

I don't know if this is a bug or if this is just not possible with c#. But it seems like it wouldn't work with any language. If you create a new script, you can't select an abstract class as baseclass. If it actually does work and I'm just too dumb to find the arguments for the constructor, please tell me where to find them in the future (because you don't find them in the base c# class). This whole thing really confuses me, because in the "High Level Multiplayer"-tutorial it was stated that you could implement your own version of the NetworkedMultiplayerPeer if you wanted to. I got my network communication working, this was the last step to "complete" the networking part.

Minimal reproduction project: BugReport.zip

Calinou commented 4 years ago

Duplicate of #38342. (This is technically the same issue, just in C# instead of GDScript.)

The documentation was clarified in https://github.com/godotengine/godot-docs/pull/3462.