Exemple #1
0
        static void Main(string[] args)
        {
            XboxGame xg = new Halo("Halo 4")
            {
                ProductKey = "00000-00000-00000-00000"
            };                                                                          //Original Copy of Halo
            XboxGame gameCopy;

            for (int x = 0; x < 10; x++)
            {
                Thread.Sleep(2000); //Not specific to this design pattern.
                gameCopy            = xg.Clone();
                gameCopy.ProductKey = XboxGame.ProductKeyGeneration();
                Console.WriteLine("Game Title: {0} Product Key: {1}", gameCopy.Title, gameCopy.ProductKey);
            }
            Console.Read();
        }
        static void Main(string[] args)
        {
            XboxGame xg = new Halo("Halo 4") { ProductKey = "00000-00000-00000-00000" }; // ORIGINAL COPY OF HALO
            XboxGame xg2 = new FinalFantasy("Final Fantasy X") { ProductKey = "00000-00000-00000-00000" }; // ORIGINAL COPY
            XboxGame gameCopy;

            for (int x = 0; x < 5; x++)
            {
                Thread.Sleep(2000);
                gameCopy = xg.Clone();
                gameCopy.ProductKey = XboxGame.ProductKeyGeneration();
                Console.WriteLine("Game Title: {0} Product Key: {1}", gameCopy.Title, gameCopy.ProductKey);

                Thread.Sleep(2000);
                gameCopy = xg2.Clone();
                gameCopy.ProductKey = XboxGame.ProductKeyGeneration();
                Console.WriteLine("Game Title: {0} Product Key: {1}", gameCopy.Title, gameCopy.ProductKey);
            }

            Console.ReadKey();
        }