private void AddLot() { var itemid = RandItemId(); if (itemid != 0) { eqService.AddItem(itemid, myHero); } }
public bool Buy(int itemId, int quantity) { if (!eqService.HaveEmptySpace(myHero)) { return(false); } var item = itemDal.Read(itemId); if (myHero.Money < item.Price) { return(false); } if (myHero.Level < item.RequiredLevel) { return(false); } heroService.RemoveMoney(item.Price, myHero); heroDal.Update(myHero); eqService.AddItem(itemId, myHero, quantity); return(true); }