Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: C#, How to code an entity Drawable and Transformable?  (Read 8304 times)

0 Members and 1 Guest are viewing this topic.

Brikinhos

  • Newbie
  • *
  • Posts: 8
    • View Profile
C#, How to code an entity Drawable and Transformable?
« on: June 18, 2020, 03:26:02 pm »
Hi all, I'm porting my project from C++ to C# and I encountered a problem, I have a class Entity that inherits from Drawable and Transformable, but C# doesn't allow multiple inheritance. How can I do that? Thanks in advance.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: C#, How to code an entity Drawable and Transformable?
« Reply #1 on: June 19, 2020, 10:34:38 am »
Drawable is an interface while Transformable is a class, so you can derive from the Transformable class and implement the interface. See how it's done for the Sprite class.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Brikinhos

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: C#, How to code an entity Drawable and Transformable?
« Reply #2 on: June 19, 2020, 04:13:40 pm »
Oh damn! I feel so bad with myself xD, thanks so much!

 

anything