Beispiel #1
0
        static void Main(string[] args)
        {
            /* Gereksinimler:
             * Oyun satış yönetimi için bir sistem geliştirme
             *
             * 1.Oyuncuların sisteme kayıt olabileceği, bilgilerini güncelleyebileceği, kayıtlarını silebileceği bir ortamı simule ediniz.
             * Müşteri bilgilerinin doğruluğunu e-devlet sistemlerini kullanarak doğrulama yapmak istiyoruz.
             * (E-devlet sistemlerinde doğrulama TcNo, Ad, Soyad, DoğumYılı bilgileriyle yapılır. Bunu yapacak servisi simule etmeniz yeterlidir.)
             *
             * 2.Oyun satışı yapılabilecek satış ortamını simule ediniz.(Yapılan satışlar oyuncu ile ilişkilendirilmelidir. Oyuncunun parametre olarak metotta olması)
             *
             * 3.Sisteme yeni kampanya girişi, kampanyanın silinmesi ve güncellenmesi imkanlarını simule ediniz.
             *
             * 4.Satışlarda kampanya entegrasyonunu simule ediniz.
             *
             */

            BasePlayerManager playerManager = new SteamPlayerManager(new MernisServiceAdapter());
            //playerManager.Register(new Player() { DateOfBirth = new DateTime(1997, 1, 5).Year, PlayerId = 0, FirstName = "İrem", LastName = "Çalışkan", NationalityId = 12345678912 });
            // correct NationalityId is working!

            BasePlayerManager playerManager1 = new EpicGamesPlayerManager();

            playerManager1.Register(new Player()
            {
                DateOfBirth = new DateTime(1997, 1, 5).Year, PlayerId = 0, FirstName = "İrem", LastName = "Çalışkan", NationalityId = 12345678912
            });
            playerManager1.UpdateInformation(new Player()
            {
                DateOfBirth = new DateTime(1997, 1, 5).Year, PlayerId = 0, FirstName = "İrem", LastName = "Çalışkan", NationalityId = 12345678912
            });
            playerManager1.DeleteAccount(new Player()
            {
                DateOfBirth = new DateTime(1997, 1, 5).Year, PlayerId = 0, FirstName = "İrem", LastName = "Çalışkan", NationalityId = 12345678912
            });

            Player player1 = new Player()
            {
                PlayerId      = 1,
                FirstName     = "Ceren",
                LastName      = "Çalışkan",
                DateOfBirth   = new DateTime(1996, 11, 16).Year,
                NationalityId = 1234567891
            };

            Game game1 = new Game()
            {
                GameId = 0,
                Name   = "PUBG",
                Price  = 50
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 0,
                Name       = "Huge discount on the weekend",
                Discount   = 50
            };

            Sale sale1 = new Sale()
            {
                SaleId     = 0,
                GameName   = "PUBG",
                PlayerName = "Ceren"
            };


            GameManager gameManager = new GameManager();

            gameManager.Save(game1);
            gameManager.Update(game1);
            gameManager.Delete(game1);

            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager saleManager = new SaleManager();

            saleManager.DiscountSend(player1, game1, campaign1);
            saleManager.Sale(player1, game1, campaign1);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                Id = 1, Name = "Red Dead Redemption 2", Price = 300
            };

            Game game2 = new Game()
            {
                Id = 2, Name = "The Long Dark", Price = 60
            };

            Game game3 = new Game()
            {
                Id = 3, Name = "FIFA 2021", Price = 180
            };

            // Datalar hayali olduğu için mernisten false döner.
            Gamer gamer1 = new Gamer()
            {
                Id               = 10,
                BirthYear        = 1999,
                FirstName        = "Mustafa",
                LastName         = "Öztürk",
                UserName         = "******",
                NationalityId    = 11111111111,
                CreditCardNumber = 111111111
            };

            Gamer gamer2 = new Gamer()
            {
                Id               = 20,
                BirthYear        = 1999,
                FirstName        = "Emine Merve ",
                LastName         = "Ceylan",
                UserName         = "******",
                NationalityId    = 22222222222,
                CreditCardNumber = 222222222
            };

            Gamer gamer3 = new Gamer()
            {
                Id               = 30,
                BirthYear        = 2015,
                FirstName        = "Ayşe Sena",
                LastName         = "öztürk",
                UserName         = "******",
                NationalityId    = 33333333333,
                CreditCardNumber = 33333333
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId   = 100,
                CampaignName = "Yaz İndirimleri",
                Discount     = 25
            };

            Campaign campaign2 = new Campaign()
            {
                CampaignId   = 200,
                CampaignName = "Yarı Yarıya",
                Discount     = 50
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign1);
            campaignManager.Update(campaign2);


            CustomerManager customerManager = new GamerManager(new MernisServiceAdapter());

            customerManager.Save(gamer3);
            customerManager.Save(gamer1);
            customerManager.Save(gamer2);
            customerManager.Update(gamer2);


            Sales sales1 = new Sales()
            {
                Game = game1.Name, Gamer = gamer3.UserName
            };

            SalesManager salesManager = new SalesManager();

            salesManager.Buy(game3, gamer3);
            salesManager.Buy(game1, gamer2);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            BasePlayerManager playerManager1 = new SteamPlayerManager(new PlayerCheckManager());

            playerManager1.Register(new Player()
            {
                DateOfBirth = new DateTime(1995, 12, 11).Year, PlayerId = 0, FirstName = "Emre", LastName = "Aksu", NationalityId = 22233344555
            });
            playerManager1.UpdateInformation(new Player()
            {
                DateOfBirth = new DateTime(1995, 12, 11).Year, PlayerId = 0, FirstName = "Emre", LastName = "Aksu", NationalityId = 22233344555
            });
            playerManager1.DeleteAccount(new Player()
            {
                DateOfBirth = new DateTime(1995, 12, 11).Year, PlayerId = 0, FirstName = "Emre", LastName = "Aksu", NationalityId = 22233344555
            });

            Player player1 = new Player()
            {
                PlayerId      = 10,
                FirstName     = "Emre",
                LastName      = "Aksu",
                DateOfBirth   = new DateTime(1995, 12, 11).Year,
                NationalityId = 22233344555
            };

            Game game1 = new Game()
            {
                GameId = 1,
                Name   = "COD",
                Price  = 100
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 0,
                Name       = "Discount on the weekend",
                Discount   = 30
            };

            GameManager gameManager = new GameManager();

            gameManager.Save(game1);
            gameManager.Update(game1);
            gameManager.Delete(game1);

            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager saleManager = new SaleManager();

            saleManager.DiscountSend(player1, game1, campaign1);
            saleManager.Sale(player1, game1, campaign1);

            GameManager gameService = new GameManager();

            gameService.Save(game1);
        }