static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(); Player player1 = new Player(); Player player2 = new Player(); player1.Name = "Serkan"; player1.surName = "Önder"; player1.TCNo = "12345678910"; player1.birthDate = "16012000"; player2.Name = "Argun"; player2.surName = "Asar"; player2.TCNo = "1234566789"; player2.birthDate = "28121999"; playerManager.Add(player1); playerManager.ShowPlayer(player1); playerManager.Update(player1); playerManager.Campaignz(player1, new Campaign1()); playerManager.Delete(player1); playerManager.Add(player2); playerManager.ShowPlayer(player2); playerManager.Update(player2); playerManager.Campaignz(player2, new Campaign3()); playerManager.Delete(player2); }
static void Main(string[] args) { Player player1 = new Player { FirstName = "Mert", LastName = "Özdemir", Id = 1, IdentityNumber = 123465789, YearOfBirth = 1986 }; Player player2 = new Player { FirstName = "Ahmet", LastName = "Yıldız", Id = 2, IdentityNumber = 1234657890, YearOfBirth = 1985 }; Game game1 = new Game { Id = 1, Name = "PUBG", UnitPrice = 250 }; userValidationManager userValidationManager = new userValidationManager(); GameSalesPlatformManager gameSalesPlatformManager = new GameSalesPlatformManager(); CampaignManager campaignManager = new CampaignManager(); PlayerManager playerManager = new PlayerManager(new userValidationManager()); playerManager.Add(player1); playerManager.Delete(player2); playerManager.Update(player2); gameSalesPlatformManager.Sale(player2, game1); campaignManager.NewYearCampaign(player1, game1); campaignManager.NewYearCampaign(player2, new Game { Id = 2, Name = "CS", UnitPrice = 400 }); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new UserValidationManager()); Player player = new Player { Id = 1, FirstName = "EMRAH", LastName = "RAMAZAN", BirthYear = 1991, IdentityNumber = 11111111111 }; playerManager.Add(player); playerManager.Update(player); playerManager.Delete(player); GameManager gameManager = new GameManager(); Game game = new Game { Id = 1, Name = "Call Of Duty", UnitPrice = 500 }; gameManager.Add(game); gameManager.Update(game); gameManager.Delete(game); CampaignManager campaignManager = new CampaignManager(); Campaign campaign = new Campaign { Id = 1, Name = "Savaş Oyununda İndirim", Discount = 50 }; campaignManager.Add(campaign); campaignManager.Update(campaign); campaignManager.Delete(campaign); SaleManager saleManager = new SaleManager(); saleManager.Sale(player, game); saleManager.CampaignSale(player, game, campaign); }
static void Main(string[] args) { Player player1 = new Player() { PlayerFirstName = "Arda Cenker", PlayerLastName = "Karagöz", Birthday = 2005, TcNo = "456161268486" }; Player player2 = new Player() { PlayerFirstName = "Ahmet", PlayerLastName = "Uçan", Birthday = 2009, TcNo = "516515455135" }; Player player3 = new Player() { PlayerFirstName = "Burak", PlayerLastName = "Kuş", Birthday = 2007, TcNo = "115156456166" }; PlayerManager playerManager = new PlayerManager(); playerManager.Add(player1); playerManager.Update(player2); playerManager.Delete("115156456166"); Games game1 = new Games(); game1.GameName = "Assassin's Creed : Valhalla"; game1.GameType = "Open World Action"; game1.GameId = 1; game1.GamePrice = 249.90; Games game2 = new Games(); game2.GameName = "Need For Speed : Heat"; game2.GameType = "Racing"; game2.GameId = 2; game2.GamePrice = 149.90; Games game3 = new Games(); game3.GameName = "Doom Eternal"; game3.GameType = "FPS Shooter"; game3.GameId = 3; game3.GamePrice = 119.90; Games game4 = new Games(); game4.GameName = "Euro Truck Simulator"; game4.GameType = "Simulation"; game4.GameId = 4; game4.GamePrice = 29.90; GameManager games = new GameManager(); games.Add(game1); games.Update(game2); games.Delete("Doom Eternal"); //games.BuyGame("Euro Truck Simulator"); }
static void Main(string[] args) { Player player1 = new Player() { TCNo = "22222222222", FirstName = "Engin", LastName = "Demiroğ", NickName = "The SOLID Developer", YearofBirth = "1985" }; User user1 = new User() { TCNo = "22222222222", FirstName = "Engin", LastName = "Demiroğ", YearofBirth = "1985" }; Game game1 = new Game() { GameName = "Rocket League", GamePrice = 30 }; VerifyManager verifyManager = new VerifyManager(); verifyManager.Verification(player1, user1); PlayerManager playerManager1 = new PlayerManager(); playerManager1.Add(player1); GameManager gameManager = new GameManager(); gameManager.Add(game1); ICampaign winterSale = new WinterSale(); winterSale.Update(game1); GameManager gameManager1 = new GameManager(); gameManager1.Sell(game1, player1); winterSale.Delete(game1); playerManager1.Delete(player1); }
static void Main(string[] args) { BasePlayerManager playerManager = new PlayerManager(); playerManager.Add(new Player { FirstName = "Kevser", LastName = "Canca", NationalityId = "37229058689", NickName = "KvsrCn" }); BasePlayerManager playerManager1 = new PlayerManager(); playerManager1.Update(new Player { FirstName = "Kevser", LastName = "CANCA", NationalityId = "37229058689", NickName = "Kvsr" }); BasePlayerManager playerManager2 = new PlayerManager(); playerManager2.Delete(new Player { FirstName = "Kağan", LastName = "Canca", NationalityId = "32234789098", NickName = "Kğn" }); BasePlayerManager gameManager = new GameManager(); gameManager.BuyGame(new Game { Id = 1, Name = "Green World", Price = 100 }); Console.ReadLine(); }
static void Main(string[] args) { OldPlayer player1 = new OldPlayer(); player1.Id = 1; player1.TcNo = "12345678901"; player1.PlayerName = "Bircan"; player1.PlayerLastName = "ÇİFTÇİ"; player1.DateOfBirth = new DateTime(1998, 8, 21); player1.GameDegree = "Gold 1"; OldPlayer player2 = new OldPlayer(); player2.Id = 2; player2.TcNo = "12345678910"; player2.PlayerName = "Serhat"; player2.PlayerLastName = "DEVECİ"; player2.DateOfBirth = new DateTime(1997, 8, 8); player2.GameDegree = "Platinum 1"; NewPlayer player3 = new NewPlayer(); player3.Id = 3; player3.TcNo = "12345678910"; player3.PlayerName = "Serhat"; player3.PlayerLastName = "DEVECİ"; player3.DateOfBirth = new DateTime(1986, 5, 16); player3.MembershipReference = "Ocak1234"; PlayerManager playerManager = new PlayerManager(); playerManager.Add(); playerManager.Delete(); playerManager.Update(); Games games1 = new Games(); games1.Id = 1; games1.GameName = "LOL"; games1.GameType = "Strategy"; games1.GamePrice = 25; games1.GameYear = 2010; Games games2 = new Games(); games2.Id = 2; games2.GameName = "Days Gone"; games2.GameType = "Action"; games2.GamePrice = 50; games2.GameYear = 2018; GameCampaign campaing1 = new GameCampaign(); campaing1.Id = 1; campaing1.CampaignName = "New Years"; campaing1.Campaign = 10; GameCampaign campaing2 = new GameCampaign(); campaing2.Id = 1; campaing2.CampaignName = "Student"; campaing2.Campaign = 20; GameCampaign campaign = new GameCampaign(); campaign.CampaignAdd(); campaign.CampaignDelete(); campaign.CampaingUpdate(); GameManager gameManager = new GameManager(); gameManager.Add(games1); gameManager.Add(games2); GameSale gameSale1 = new GameSale(player1, games1, campaing1); gameSale1.GameSales(); GameSale gameSale2 = new GameSale(player2, games2, campaing2); gameSale2.GameSales(); }
static void Main(string[] args) { IPlayer player1 = new OldPlayer() { TcNo = "1", BirthYear = 1998, PlayerName = "Seçkin", PlayerSurname = "Bakir", MembershipYear = 2 }; IPlayer player2 = new OldPlayer() { TcNo = "2", BirthYear = 1985, PlayerName = "Engin", PlayerSurname = "Demiroğ", MembershipYear = 20 }; PlayerManager playerManager = new PlayerManager(); playerManager.Add(player1); playerManager.Add(player2); GameManager gameManager = new GameManager(); gameManager.Add(new Game() { GameName = "Death Stranding", GameType = "Action", GamePrice = 499, GameReleaseYear = 2018, GameReviewScore = 8.3 }); gameManager.Add(new Game() { GameName = "Days Gone", GameType = "Action,Zombie", GamePrice = 139, GameReleaseYear = 2018, GameReviewScore = 7.3 }); gameManager.Add(new Game() { GameName = "Persona 5", GameType = "JRPG", GamePrice = 99, GameReleaseYear = 2015, GameReviewScore = 9.1 }); gameManager.Add(new Game() { GameName = "Cyberpunk 2077", GameType = "RPG", GamePrice = 499, GameReleaseYear = 2020, GameReviewScore = 7.1 }); gameManager.Add(new Game() { GameName = "Witcher 3", GameType = "RPG", GamePrice = 49, GameReleaseYear = 2015, GameReviewScore = 9.3 }); while (true) { Console.WriteLine("**********MENU**********"); Console.WriteLine("1-)Oyuncu Ekle\n2-)Oyuncu Sil\n3-)Kullanıcıları Listele\n4-)Oyun Ekle\n5-)Oyun Sil\n6-)Oyunları Listele\n7-)Oyunları İnceleme Puanına Göre Listele\n8-)Kampanya Seçiniz\n9-)Çıkış"); Console.WriteLine("************************"); int choice = Convert.ToInt32(Console.ReadLine()); Console.Clear(); if (choice == 1) { Console.WriteLine("Eklemek istediğiniz kullanıcı bilgilerini giriniz"); Console.WriteLine("Tc no:"); string TcNo = Console.ReadLine(); Console.WriteLine("Ad:"); string PlayerName = Console.ReadLine(); Console.WriteLine("Soyad:"); string PlayerSurname = Console.ReadLine(); Console.WriteLine("Doğum Yılı:"); int BirthYear = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Kaç yıl kullanmayı taahhüt ediyorsunuz:"); int UndertakingYear = Convert.ToInt32(Console.ReadLine()); playerManager.Add(new NewPlayer() { TcNo = TcNo, PlayerName = PlayerName, PlayerSurname = PlayerSurname, BirthYear = BirthYear, UndertakingYear = UndertakingYear }); } else if (choice == 2) { Console.WriteLine("Silmek istediğiniz oyuncunun Tc Numarasını giriniz:"); playerManager.Delete(Console.ReadLine()); } else if (choice == 3) { playerManager.ListPlayer(); } else if (choice == 4) { Console.WriteLine("Eklemek istediğiniz oyunun bilgilerini giriniz"); Console.WriteLine("Oyun Adı:"); string GameName = Console.ReadLine(); Console.WriteLine("Oyunun Çıkış Yılı:"); int GameReleaseYear = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Oyunun Türü:"); string GameType = Console.ReadLine(); Console.WriteLine("Oyunun Fiyatı:"); double GamePrice = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Oyunun İnceleme Puanı:"); double GameReviewScore = Convert.ToDouble(Console.ReadLine()); gameManager.Add(new Game() { GameName = GameName, GameReleaseYear = GameReleaseYear, GameType = GameType, GamePrice = GamePrice, GameReviewScore = GameReviewScore }); } else if (choice == 5) { Console.WriteLine("Silmek istediğiniz oyuncunun Adını giriniz:"); gameManager.Delete(Console.ReadLine()); } else if (choice == 6) { gameManager.ListGame(); } else if (choice == 7) { gameManager.SortByReviewScores(); } else if (choice == 8) { while (true) { Console.WriteLine("**********KAMPANYALAR**********"); Console.WriteLine("-1-Öğrenci Kampanyası\n-2-Kara Cuma Kampanyası\n-3-Ana Menüye Dön"); Console.WriteLine("*******************************"); int choice2 = Convert.ToInt32(Console.ReadLine()); Console.Clear(); if (choice2 == 1) { gameManager.ListGame(); Console.WriteLine("Yukarıdaki oyunlardan öğrencisi kampanyası uygulamak istediğiniz oyunun adını yazınız:"); string name = Console.ReadLine(); Console.Clear(); ICampaignService campaign = new StudentCampaign(); gameManager.GetGame(name, campaign); } else if (choice2 == 2) { gameManager.ListGame(); Console.WriteLine("Yukarıdaki oyunlardan kara cuma kampanyası uygulamak istediğiniz oyunun adını yazınız:"); string name = Console.ReadLine(); Console.Clear(); ICampaignService campaign = new BlackFridayCampaign(); gameManager.GetGame(name, campaign); } else { break; } } } else { Console.WriteLine("Programdan çıkış yaptınız.\nİyi günler..."); break; } } }
static void Main(string[] args) { bool exit = false; PlayerManager playerManager = new PlayerManager(new MernisServiceAdapter()); CampaignManager campaignManager = new CampaignManager(); GameManager gameManager = new GameManager(new MernisServiceAdapter(), campaignManager); while (exit != true) { Console.WriteLine("---Menü-----"); Console.WriteLine("1- Oyuncu Listele \n2- Oyuncu Ekle \n3-Oyuncu Sil \n4-Oyuncu Güncelle \n" + "5- Kampanya Listele \n6- Kampanya Ekle \n7- Kampanya Sil \n8- Kampanya Güncelle \n" + "9- Oyunları Listele \n10- Oyun Ekle \n11- Oyun Sil \n12- Oyun Güncelle \n13- Oyun Satın Al \n" + "14- Sistemden Çıkış Yap"); Console.WriteLine("-----------------"); Console.WriteLine("Lütfen yapmak istediğiniz işlemi seçiniz"); int choice = Convert.ToInt32(Console.ReadLine()); Console.Clear(); switch (choice) { case 1: playerManager.List(); Console.ReadLine(); break; case 2: Console.WriteLine("Eklenecek oyuncunun sırası ile Id Ad Soyad TC Doğum yılı ve telefon numarasını giriniz"); playerManager.Save(new Player { Id = Convert.ToInt32(Console.ReadLine()), FirstName = Console.ReadLine(), LastName = Console.ReadLine(), NationalityId = Console.ReadLine(), BirthYear = Convert.ToInt32(Console.ReadLine()), PhoneNumber = Console.ReadLine() }); break; case 3: Console.WriteLine("Silinecek Oyuncunun sırası ile Ad Soyad TC Doğum yılı bilgilerini giriniz "); playerManager.Delete(new Player { FirstName = Console.ReadLine(), LastName = Console.ReadLine(), NationalityId = Console.ReadLine(), BirthYear = Convert.ToInt32(Console.ReadLine()) }); break; case 4: Console.WriteLine("Güncellenecek oyuncunun tc numarasını giriniz"); playerManager.Update(new Player { NationalityId = Console.ReadLine() }); break; case 5: campaignManager.List(); Console.ReadLine(); break; case 6: Console.WriteLine("Eklenecek olan kampanyanın ıd numarasını, adını ve indirim oranını giriniz "); campaignManager.Add(new Campaign { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), DiscountRate = Convert.ToDouble(Console.ReadLine()) }); break; case 7: Console.WriteLine("Silinecek olan kampanya ıd numarasını, adını ve indirim oranını giriniz"); campaignManager.Delete(new Campaign { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), DiscountRate = Convert.ToDouble(Console.ReadLine()) }); break; case 8: Console.WriteLine("Önce güncellemek istediğiniz kampanyanın ıd numarasını, adını ve indirim oranını " + "daha sonra güncellenmiş kampanyanın ıd numarasını, adını ve indirim oranını giriniz"); campaignManager.Update(new Campaign { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), DiscountRate = Convert.ToDouble(Console.ReadLine()) }, new Campaign { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), DiscountRate = Convert.ToDouble(Console.ReadLine()) }); break; case 9: gameManager.List(); Console.ReadLine(); break; case 10: Console.WriteLine("Eklenecek olan oyunun ıd numarasını, adını ve fiyatını giriniz "); gameManager.Add(new Game { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), Price = Convert.ToInt32(Console.ReadLine()) }); break; case 11: Console.WriteLine("Silinecek olan oyunun ıd numarasını, adını ve fiyatınıgiriniz"); gameManager.Delete(new Game { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), Price = Convert.ToInt32(Console.ReadLine()) }); break; case 12: Console.WriteLine("Önce güncellemek istediğiniz oyunun ıd numarasını, adını ve fiyatını " + "daha sonra güncellenmiş oyunun ıd numarasını, adını ve fiyatını giriniz"); gameManager.Update(new Game { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), Price = Convert.ToInt32(Console.ReadLine()) }, new Game { Id = Convert.ToInt32(Console.ReadLine()), Name = Console.ReadLine(), Price = Convert.ToInt32(Console.ReadLine()) }); break; case 13: campaignManager.List(); Console.WriteLine("Satın almak istediğiniz oyunun adını, uygulamak istediğiniz kampanyanın Id numarasını ve sırası ile Ad Soyad TC Doğum yılı bilgilerinizi giriniz "); gameManager.Buy(new Game { Name = Console.ReadLine() }, new Campaign { Id = Convert.ToInt32(Console.ReadLine()) }, new Player { FirstName = Console.ReadLine(), LastName = Console.ReadLine(), NationalityId = Console.ReadLine(), BirthYear = Convert.ToInt32(Console.ReadLine()) }); Console.ReadLine(); break; case 14: exit = true; break; } Console.Clear(); } }
static void Main(string[] args) { Player player1 = new Player() { TcNo = "123456789", FirstName = "Yaren", LastName = "Şahin", BirthDateYear = 1998 }; Player player2 = new Player() { TcNo = "987654321", FirstName = "Ali", LastName = "Kara", BirthDateYear = 1997 }; Game myGame = new Game() { Name = "MyGame", Price = 100 }; Console.WriteLine("-------------Welcome-------------"); GameManager gameManager = new GameManager(); IPlayerCheckService playerCheckService = new PlayerCheckManager(); PlayerManager playerManager = new PlayerManager(playerCheckService); CampaignManager salesManager = new CampaignManager(); ICampaign newCampaign = new NewCampaign(); ICampaign blackFridayCampaign = new BlackFridayCampaign(); ICampaign summerCampaign = new SummerCampaign(); List <Player> listPlayer = new List <Player>() { player1, player2 }; List <ICampaign> campaigns = new List <ICampaign>() { blackFridayCampaign, summerCampaign }; gameManager.Display(myGame); Console.WriteLine("Please choose an option:"); Console.WriteLine("1)Add player\n2)Update player\n3)Delete player\n4)Buy the game\n5)Display campaigns\n" + "6)Apply Discount\n7)Add a new campaign\n8)Update the campaign\n9)Delete the campaign\n10)Exit"); int x = Convert.ToInt32(Console.ReadLine()); switch (x) { case 1: Player player = new Player(); Console.WriteLine("Tc No:"); player.TcNo = Console.ReadLine(); Console.WriteLine("First Name:"); player.FirstName = Console.ReadLine(); Console.WriteLine("Last Name:"); player.LastName = Console.ReadLine(); Console.WriteLine("BirthDateYear:"); player.BirthDateYear = Convert.ToInt32(Console.ReadLine()); playerManager.Add(player); break; case 2: playerManager.Update(player1); break; case 3: playerManager.Delete(player1); break; case 4: gameManager.Buy(player1); break; case 5: salesManager.DisplayCampaigns(campaigns); break; case 6: salesManager.ApplyDiscount(myGame); break; case 7: salesManager.AddNewCampaign(newCampaign); break; case 8: salesManager.UpdateCampaign(blackFridayCampaign); break; case 9: salesManager.DeleteCampaign(summerCampaign); break; case 10: break; default: Console.WriteLine("Invalid choice"); break; } }
static void Main(string[] args) { Player player1 = new Player(); player1.Id = 1; player1.FirstName = "Tuğçe"; player1.LastName = "Kadem"; player1.DateOfBirth = new DateTime(2000, 11, 17); player1.NationaltyId = "123456789"; Player player2 = new Player(); player2.Id = 2; player2.FirstName = "Yiğit"; player2.LastName = "Karademir"; player2.DateOfBirth = new DateTime(1998, 7, 15); player2.NationaltyId = "987654321"; PlayerManager playerManager1 = new PlayerManager(new MernisServiceAdapters()); playerManager1.Add(player1); playerManager1.Update(player1); playerManager1.Delete(player2); Game game1 = new Game(); game1.Id = 1; game1.GameName = "oyun 1"; game1.GamePrice = 150; Game game2 = new Game(); game2.Id = 2; game2.GameName = "oyun 2"; game2.GamePrice = 100; SalesManager salesManager = new SalesManager(); salesManager.Sales(player1, game1); Campaign campaign1 = new Campaign(); campaign1.Id = 1; campaign1.CampaignName = "kampanya 1"; campaign1.DiscountRate = 50; Campaign campaign2 = new Campaign(); campaign2.Id = 2; campaign2.CampaignName = "kampanya 2"; campaign2.DiscountRate = 30; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign2); campaignManager.Update(campaign2); SalesManager salesManager1 = new SalesManager(); salesManager1.CampaignSales(player1, game2, campaign1); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new UserCheckManager()); CampaignManager campaignManager = new CampaignManager(); SalesManager salesManager = new SalesManager(); Game game1 = new Game { Id = 1, Name = "PlayerUnknown's Battlegrounds", Price = 87 }; Game game2 = new Game { Id = 2, Name = "Counter-Strike: Global Offensive", Price = 127 }; Game game3 = new Game { Id = 3, Name = "Valorant", Price = 50 }; Console.WriteLine("\n------ Kullanıcı Ekle Sil Güncelle Yönetimi-------\n"); Players player1 = new Players() { Id = 1, FirstName = "Ahmet", LastName = "Yılmaz", BirtDateYear = "1986", NationalId = 123456789 }; playerManager.Add(player1); playerManager.Update(player1); playerManager.Delete(player1); Console.WriteLine("\n------ Kampanya Ekle Sil Güncelle Yönetimi -------\n"); Campaign campaign1 = new Campaign { CampignName = "Yeni Oyuncu İndirimi", DiscountRate = 0.1 }; Campaign campaign2 = new Campaign { CampignName = "Kış İndirimi", DiscountRate = 0.2 }; Campaign campaign3 = new Campaign { CampignName = "Yeni Sezon İndirimi", DiscountRate = 0.3 }; campaignManager.Add(campaign1); campaignManager.Update(campaign2); campaignManager.Delete(campaign1); Console.WriteLine("\n------ Normal Satış -------\n"); salesManager.SellGame(player1, game3); Console.WriteLine("\n------ Kampanyalı Satış -------\n"); salesManager.CampaignGame(player1, game2, campaign2); Console.WriteLine(); salesManager.CampaignGame(player1, game1, campaign3); }