It's been a SUPER long time since I've worked with C#, so I'm a bit fuzzy on this one.
Here's what I've got:
I have two classes; Player, and AIPlayer. AIPlayer is derived from Player. I want to use a container that will hold both types, and be able to call methods from each object as its own class. I've attempted ArrayList, using similar to the following code:
Code:
System.Collections.ArrayList players = new System.Collections.ArrayList();
Player one = new Player();
AIPlayer two = new AIPlayer();
players.Add(one);
players.Add(two);
players[0].Move;
players[1].Move;
...etc
players[0] returns an object, not a player or AIPlayer.
Ideas?