Maybe I'm missing something here, but why doesn't this work? -
Since tMapLarge extends tMap, shouldn't the Create function be inherited? Instead I get a compile error stating that it's unable to convert from tMap to tMapLarge. Do I need to override the Create function for the derived type?
Type tMap Field height:Int Field width:Int Function Create:tMap(width:Int, height:Int) Local tempMap:tMap = New tMap tempMap.width=width tempMap.height=height Return tempMap EndFunction EndType Type tMapLarge Extends tMap Field tiles:Int [100,100] EndType Global map:tMapLarge = tMapLarge.Create(20,20)
Since tMapLarge extends tMap, shouldn't the Create function be inherited? Instead I get a compile error stating that it's unable to convert from tMap to tMapLarge. Do I need to override the Create function for the derived type?