I want to see if there is a way to do this… I’m Using vs2010 with the WP7 SDK. (VB.NET)
I am declaring this in the global scope.
public objGame as object
then say i have classes: Game1 and Game2
for the sake of the example we’ll just say both classes have an Update() function
I want to set objGame = Game1 (or Game2)
and then be able to call objGame.Update()
is there a way to do this?
Declare an interface IGame with method Update(). Inherit both of Game1 and Game2 from it.
Here’s wiki link on Polymorphism in OOP.