Beispiel #1
0
        static void Main(string[] args)
        {
            IPlayer player1 = new AdvancedPlayer();

            IPlayer player2 = new Admin();  // Age, Name, Password
            Admin   player3 = new Admin();  // Age, Name, Password, Insert
            Player  player4 = new Player(); // Age, Name, Password

            //player4 = (Admin)player3; // InvalidCastException

            Console.WriteLine(player1.GetType().Name); // AdvancedPlayer
            Console.WriteLine(player2.GetType().Name); // Admin
        }
 public void Play(String audioType, String fileName)
 {
     _advancedPlayer = new AviPlayer();
     _advancedPlayer.PlayAvi(fileName);
 }