I'm working to switch fully to FPC, and I need to know something I'm struggling to find in the documentation. In Delphi I can declare the following type:
Code:
type
  TTypeOfMyStuff = class of TMyObject;
When I assign a variable this type I can point it at any descendant class, and from there even call a constructor and anonymously create that object. How do I do this in FPC? I want to be able to serialize my game, for saving it of course, and in doing so specify the types of objects and let them unserialize themselves. Of course I must first be able to recognize and point at the class itself.

Thanks in advance.