コード例 #1
0
        public static void Main(string[] args)
        {
            Game game = new Cricket();

            game.play();
            Console.WriteLine();
            game = new Football();
            game.play();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: adad122/DesignPattern
        static void Main(string[] args)
        {
            Game game = new Cricket();

            game.Play();

            game = new Football();
            game.Play();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Game football = new Football();

            football.PlayGame();
            Game basketball = new Basketball();

            basketball.PlayGame();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            Game game = new Cricket();

            game.Play();
            Console.WriteLine("");
            game = new Football();
            game.Play();

            Console.Read();
        }