Quantcast
Channel: Latest Questions by Panopolos
Viewing all articles
Browse latest Browse all 18

How to create an array of Classes?

$
0
0
I'm trying to write my own save/load serializer and my interactive objects all have a class that derives from a base object class. What I want to do is, at save time, check to see if all of the objects in my inventory match to a certain child class of object. I'm looking for something like this: class[] classes = { object, meleeWeapon, shootingWeapon }; Where object, meleeWeapon, and shootingWeapon are all classes and the latter two are inherited from object.

Viewing all articles
Browse latest Browse all 18

Trending Articles