Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                FirstName = "Aysu", LastName = "Gökcen", UserName = "******", IdentityNumber = "53687496148", YearOfBirth = 1999, Password = "******"
            };
            Gamer gamer2 = new Gamer()
            {
                FirstName = "Engin", LastName = "DEMİROĞ", UserName = "******", IdentityNumber = "53650145678", YearOfBirth = 1991, Password = "******", Balance = 70
            };


            Console.WriteLine("----GAME STORE----");
            Game game1 = new Game()
            {
                GameName = "Counter Strike", GamePrice = 30, Limit = 1996
            };
            Game game2 = new Game()
            {
                GameName = "Call of Duty", GamePrice = 40, Limit = 1996
            };
            Game game3 = new Game()
            {
                GameName = "BattleField", GamePrice = 35, Limit = 1996
            };
            Game game4 = new Game()
            {
                GameName = "Deceit /SELECTED GAME", GamePrice = 20, Limit = 1998
            };
            Game game5 = new Game()
            {
                GameName = "Football Manager /SELECTED GAME", GamePrice = 25, Limit = 2010
            };

            Game[] games = { game1, game2, game3, game4, game5 };
            foreach (Game game in games)
            {
                Console.WriteLine(game.GameName + ": $" + game.GamePrice);
            }


            Console.WriteLine("\n----SIGN UP / SIGN IN----");
            GamerManager gamerManager = new GamerManager(new ConfirmGamerManager());

            gamerManager.SignUp(gamer1);
            gamerManager.SignIn(gamer2);


            Console.WriteLine("\n ----CAMPAIGN----");
            Campaign campaign1 = new Campaign()
            {
                CampaignName = "Four-day new member bonus", CampaignPrice = 20
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignName = "Buy one for free in selected games", CampaignPrice = 0
            };

            Campaign[] campaigns = { campaign1, campaign2 };
            foreach (var campaign in campaigns)
            {
                Console.WriteLine(campaign.CampaignName + ": $" + campaign.CampaignPrice);
            }


            Console.WriteLine("\n----PURCHASE----");
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign1, gamer2, game2);
            //campaignManager.Delete(campaign1, gamer2, game2);
            OrderManager orderManager = new OrderManager();

            orderManager.AddToBasket(game2, gamer2);

            //orderManager.TakeOutOfBasket(gamer2, game5);
        }