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); } }
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); } }
public void Add(GameCampaign gameCampaign) { Console.WriteLine("Kampanya Eklendi. "); }
public void Update(GameCampaign gameCampaign) { Console.WriteLine("Kampanya Güncellendi. "); }
public void Delete(GameCampaign gameCampaign, Person person) { Console.WriteLine("{1} Kampanyası {0} Adlı Kullanıcı İçin Silindi. ", person.FirstName, gameCampaign.EventName); }
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); }