So I’m dabbling in Silverlight and I’m working on a little project. It’s a character generator for a game. Each character has a set of attributes and talents and skills that define him.
So my question comes in on what would be best practice: Since most if not all of these elements will have a visual representation I’m thinking of inheriting their classes from custom wpf/Silverlight controls. So for example, firebreathing is class that represents the firebreathing talent in the game. It inherits from a fire class, which in turn inherits from an abstract “Talent” class, which finally inherits from my custom control class that defines how the firebreathing icon actually looks like
This seems logical to me, and yet it feels wrong. Like I shouldn’t be tying the visual elements of the program so closely into my engine. If I ever wanted to reuse my API for another purpose, I wouldn’t be able to since it inherits directly from a custom Silverlight control, right?
Should I instead pass instances of my custom controls to the API?