Reflection and name().

BlitzMax Forums/BlitzMax Beginners Area/Reflection and name().

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

well a class TItem that holds the basic functionality you might need for any item + a method that returns the type of the item as integer (for fast select or straight usage as array index)

for example you could have a method use() abstract as all items are used in a way and the extended types implement that each in its own way. pen would write something, turnip would heal or grant "stuffed" attribute, a knife would cut or attack ...
this kind of stuff.

think first of the "common" class and then think about the specialisted extended classes that the player actually will "see" (in an rpg for example)