Hi, I have three classes public class Player
, public class Computer : Player
, and public class Game
.
In Game
I have a List: public List<Player> PlayerList
and a variable Player CurrentPlayer
.
Heres what happens: when I create a new Computer()
I add it to the PlayerList
, the CurrentPlayer
acts like an Iterator and tracks the current player in the game.
Heres the Question: I want to know if(CurrentPlayer is Computer)
(this by-the-way does not work).
HuePig 0 Light Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
HuePig 0 Light Poster
DaveAmour 160 Mmmmmm beer Featured Poster
DaveAmour 160 Mmmmmm beer Featured Poster
HuePig 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.