How would I do this with reflection?
I have a some ship parts
e.g.(reactor, shield, hull, laser)
They are all types derived from
Type Ship_part
endtype
I have to press a button in the game to create a new ship part
I have the buttons name that was pressed e.g. reactor
At the moment Im doing a select case test to see what part was selected and then creating it manually in code.
How would I create a certain ship part using reflection?
(calling the create function that every ship part has)
the create function is like this:
reactor.create(s:ship,x,y)
I have a some ship parts
e.g.(reactor, shield, hull, laser)
They are all types derived from
Type Ship_part
endtype
I have to press a button in the game to create a new ship part
I have the buttons name that was pressed e.g. reactor
At the moment Im doing a select case test to see what part was selected and then creating it manually in code.
How would I create a certain ship part using reflection?
(calling the create function that every ship part has)
the create function is like this:
reactor.create(s:ship,x,y)