예제 #1
0
 public void Sell(Person person, Item item, GameCampaign gameCampaign = null)
 {
     if (gameCampaign != null)
     {
         Console.WriteLine("{0} oyuncusu tarafından {1} eşyasını {2} kampanyasındaki {3} indirimiyle satın alındı. ", person.FirstName, item.ItemName, gameCampaign.EventName, gameCampaign.Discount);
     }
     else
     {
         Console.WriteLine("{0} oyuncusu tarafından {1} eşyası satın alındı. ", person.FirstName, item.ItemName);
     }
 }
예제 #2
0
 public void BuyItem(Person person, Item ıtem, GameCampaign gameCampaign = null)
 {
     if (_playerService.CheckPlayerExistence(person, person) && gameCampaign != null)
     {
         _sellService.Sell(person, ıtem, gameCampaign);
         _gameCampaignService.Delete(gameCampaign, person);
     }
     else if (_playerService.CheckPlayerExistence(person, person) && gameCampaign == null)
     {
         _sellService.Sell(person, ıtem, gameCampaign);
     }
 }
예제 #3
0
 public void Add(GameCampaign gameCampaign)
 {
     Console.WriteLine("Kampanya Eklendi. ");
 }
예제 #4
0
 public void Update(GameCampaign gameCampaign)
 {
     Console.WriteLine("Kampanya Güncellendi. ");
 }
예제 #5
0
 public void Delete(GameCampaign gameCampaign, Person person)
 {
     Console.WriteLine("{1} Kampanyası {0} Adlı Kullanıcı İçin Silindi. ", person.FirstName, gameCampaign.EventName);
 }
예제 #6
0
        static void Main(string[] args)
        {
            Person person1 = new Person()
            {
                Id          = 1,
                FirstName   = "Emirhan",
                LastName    = "Çetin",
                TcNo        = "TcNo",
                YearofBirth = 1996,
                Role        = "Player"
            };
            Person player1 = new Person()
            {
                Id          = 1,
                FirstName   = "Emirhan",
                LastName    = "Çetin",
                TcNo        = "TcNo",
                YearofBirth = 1996,
                Role        = "Player"
            };

            Item item1 = new Item()
            {
                Id          = 2,
                ItemName    = "Abc",
                Price       = 100,
                StockAmount = 25
            };
            Item item2 = new Item()
            {
                Id          = 3,
                ItemName    = "Abcd",
                Price       = 120,
                StockAmount = 30
            };
            GameCampaign gameCampaign1 = new GameCampaign()
            {
                Id        = 4,
                EventName = "Etkinlik1",
                EventTime = DateTime.Now,
                Discount  = 20
            };
            GameCampaign gameCampaign2 = new GameCampaign()
            {
                Id        = 5,
                EventName = "Etkinlik2",
                EventTime = DateTime.Now,
                Discount  = 30
            };
            GameCampaign gameCampaign3 = new GameCampaign()
            {
                Id        = 6,
                EventName = "Etkinlik3",
                EventTime = DateTime.Now,
                Discount  = 40
            };
            GameCampaign gameCampaign4 = new GameCampaign()
            {
                Id        = 7,
                EventName = "Etkinlik4",
                EventTime = DateTime.Now,
                Discount  = 50
            };
            List <GameCampaign> gameCampaigns = new List <GameCampaign> {
                gameCampaign4, gameCampaign3, gameCampaign2, gameCampaign1
            };

            IMyGameService myGameManager = new MyGameManager
                                           (
                new PlayerManager(), new SellManager(), new GameCampaignManager()
                                           );

            myGameManager.Register(person1);
            myGameManager.Login(person1, player1);
            myGameManager.GetListCampaigns(gameCampaigns);
            myGameManager.BuyItem(person1, item2);
            myGameManager.BuyItem(player1, item1, gameCampaign4);
            myGameManager.Delete(player1);
        }