Beispiel #1
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                GamerName      = "Aslıhan",
                GamerBirthDate = "27.07.2001",
                GamerTC        = "11111111111"
            };
            GamerManager gamerManager = new GamerManager();

            EDevletInfo eDevletInfo = new EDevletInfo()
            {
                TC = "11111111111"
            };

            if (eDevletInfo.TC == gamer.GamerTC)
            {
                gamerManager.Add(gamer);
            }
            else
            {
                Console.WriteLine("kullanıcı bulunamadı");
            }
            //gamerManager.Add(gamer);
            gamerManager.Update(gamer);
            gamerManager.Delete(gamer);

            Campaign campaign = new Campaign()
            {
                Id           = 1,
                CampaignName = "Yeni Yıl İndirimi"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            SaleManager saleManager = new SaleManager();

            saleManager.Selling(gamer);
            saleManager.CampaignSelling(campaign, gamer);


            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            IPlayer player1 = new Player()
            {
                Id = 1, Name = "Dilara", LastName = "Yavuz", BirthDate = "13/12/2000", games = { }, UserName = "******", Password = "******"
            };
            IPlayer player2 = new Player()
            {
                Id = 2, Name = "Mert", LastName = "Taş", BirthDate = "06/02/1998", games = { }, UserName = "******", Password = "******"
            };

            IGame game1 = new Game()
            {
                Id = 1, Name = "Valorant"
            };
            IGame game2 = new Game()
            {
                Id = 2, Name = "Rocker League"
            };

            IPlayerManager playerManager = new PlayerManager();

            IGameManager gameManager = new GameManager();

            ICampaignManager campaignManager = new CampaignManager();

            Console.WriteLine("MENU");
            Console.WriteLine("1-Kayit ol.");
            Console.WriteLine("2-Kayit duzenle.");
            Console.WriteLine("3-Kayit sil.");
            Console.WriteLine("4-Oyun ekle.");
            Console.WriteLine("5-Oyun guncelle.");
            Console.WriteLine("6-Oyunc sil.");
            Console.WriteLine("4-Kampanya ekle.");
            Console.WriteLine("5-Kampanya guncelle.");
            Console.WriteLine("6-Kampanya sil.");
            Console.WriteLine("7-Oyun satin al.");

            int islem = Convert.ToInt32(Console.ReadLine());

            switch (islem)
            {
            case 1:
                Console.WriteLine("========== OYUNCU KAYIT ISLEMI==========");
                playerManager.Add(player1);
                playerManager.Add(player2);
                break;

            case 2:
                Console.WriteLine("========== OYUNCU KAYIT DUZENLEME ============");
                playerManager.Update(player1);
                break;

            case 3:
                Console.WriteLine("========== OYUNCU SILME ISLEMI==========");
                playerManager.Delete(player2);
                break;

            case 4:
                Console.WriteLine("========== OYUN EKLEME ISLEMI==========");
                gameManager.Add(game1);
                gameManager.Add(game2);
                break;

            case 5:
                Console.WriteLine("========== OYUN GUNCELLEME ISLEMI==========");
                gameManager.Update(game1);
                break;

            case 6:
                Console.WriteLine("========== OYUN SILME ISLEMI==========");
                gameManager.Delete(game2);
                break;

            case 7:
                Console.WriteLine("========== KAMPANYA EKLEME ISLEMI==========");
                campaignManager.Add(game1);
                gameManager.Add(game2);
                break;

            case 8:
                Console.WriteLine("========== KAMPANYA GUNCELLEME ISLEMI==========");
                campaignManager.Update(game1);
                break;

            case 9:
                Console.WriteLine("========== KAMPANYA SILME ISLEMI==========");
                campaignManager.Delete(game2);
                break;

            case 10:
                Console.WriteLine("========== OYUN SATIN ALMA ISLEMI==========");
                gameManager.GetGame(player1, game2);
                break;
            }
        }
Beispiel #3
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);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager();
            CampaignManager campaignManager = new CampaignManager();
            GamerVerificationManager gamerVerificationManager = new GamerVerificationManager();

            Gamer gamer1 = new Gamer();
            gamer1.Id = 1;
            gamer1.Name = "Fatih";
            gamer1.Surname = "Kırık";
            gamer1.TcNo = "12345678910";
            gamer1.DateOfBirth = "30/07/2000";

            Gamer gamer2 = new Gamer();
            gamer2.Id = 1;
            gamer2.Name = "Mehmet";
            gamer2.Surname = "Yılmaz";
            gamer2.TcNo = "94973675710";
            gamer2.DateOfBirth = "10/08/1995";

            Gamer eStateGamer = new Gamer();
            eStateGamer.Id = 1;
            eStateGamer.Name = "Fatih";
            eStateGamer.Surname = "Kırık";
            eStateGamer.TcNo = "12345678910";
            eStateGamer.DateOfBirth = "30/07/2000";

            Game game1 = new Game();
            game1.Id = 1;
            game1.Name = "CyberPunk 2077";
            game1.Point = 8;
            game1.Price = 300;
            game1.ReleaseDate = "10 Aralık 2020";

            Campaign campaign1 = new Campaign();
            campaign1.Id = 1;
            campaign1.Name = "Yeni yıl kampanyası";
            campaign1.RateOfCampaign = 20;

            Campaign campaign2 = new Campaign();
            campaign2.Id = 1;
            campaign2.Name = "Cadılar bayramı kampanyası";
            campaign2.RateOfCampaign = 20;


            //KAYIT VE DOĞRULAMA İŞLEMİ 
            gamerManager.Register(gamer1, eStateGamer, gamerVerificationManager);
            Console.WriteLine();

            //GİRİŞ İŞLEMİ
            gamerManager.Login(gamer1);
            Console.WriteLine();

            //KULLANICI BİLGİSİ GÜNCELLEME İŞLEMİ 
            gamerManager.Update(gamer2,gamer1);
            Console.WriteLine();

            //ÇIKIŞ İŞLEMİ
            gamerManager.LogOut(gamer1);
            Console.WriteLine();

            //KULLANICI SİLME
            gamerManager.Delete(gamer1);
            Console.WriteLine();

            //KAMPANYA EKLEME İŞLEMİ
            campaignManager.Add(campaign1);
            Console.WriteLine();

            //KAMPANYA GÜNCELLEME İŞLEMİ
            campaignManager.Update(campaign2, campaign1);
            Console.WriteLine();

            //KAMPANYA SİLME İŞLEMİ
            campaignManager.Delete(campaign1);
            Console.WriteLine();

            //KAMPANYALI OYUN SATIŞ İŞLEMİ
            gamerManager.SellGameCampaign(gamer1, game1, campaign1);
            Console.WriteLine();

            //KAMPANYASIZ OYUN SATIŞ IŞLEMİ
            gamerManager.SellGame(gamer1, game1);
            Console.WriteLine();

            






        }