Blitzmax does not allow me to have one constructor and cast it down to its child.
or am I doing something wrong?
Strict Type Father Field Name:String Function create:Father(s:String) Local f:Father=New Father f.Name=s Return f End Function Method display() Print "Name:"+Name+" Type:Father" End Method End Type Type son Extends Father Method display() Print "Name:"+Name+" Type:Son" End Method End Type Type daughter Extends Father Method display() Print "Name:"+Name+" Type:Daughter" End Method End Type Local Man:Father=Father.Create("John") Man.Display() Local Boy:Son=Son(Father.Create("Jack")) Boy.Display() Local Girl:Daughter=Daughter(Father.Create("Jill")) Girl.Display() End
or am I doing something wrong?