public async Task <ActionResult <SShop> > PostSShop(SShop sShop) { _context.SShops.Add(sShop); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSShop", new { id = sShop.Id }, sShop)); }
public async Task <IActionResult> PutSShop(int id, SShop sShop) { if (id != sShop.Id) { return(BadRequest()); } _context.Entry(sShop).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SShopExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private IEnumerator Build(int buildId, VBaseMap vBaseMap, App.Model.Master.MBuilding buildingMaster) { App.Model.Master.MBaseMap topMapMaster = BaseMapCacher.Instance.Get(vBaseMap.ViewModel.MapId.Value); Vector2 coordinate = topMapMaster.GetCoordinateFromIndex(tileIndex); SShop sShop = new SShop(); yield return(StartCoroutine(sShop.RequestBuyBuild(buildId, (int)coordinate.x, (int)coordinate.y))); App.Model.MTile currentTile = App.Model.MTile.Create(buildingMaster.tile_id, (int)coordinate.x, (int)coordinate.y); List <App.Model.MTile> tileList = vBaseMap.ViewModel.Tiles.Value.ToList(); tileList.Add(currentTile); vBaseMap.ViewModel.Tiles.Value = tileList.ToArray(); this.Close(); }
public override IEnumerator OnLoad(Request request) { yield return(StartCoroutine(base.OnLoad(request))); SShop sShop = new SShop(); yield return(StartCoroutine(sShop.Download(ShopAsset.Url, App.Util.Global.versions.shop, (AssetBundle assetbundle) => { ShopAsset.assetbundle = assetbundle; ShopCacher.Instance.Reset(ShopAsset.Data.shopItems); ShopAsset.Clear(); }))); App.Model.Master.MShopItem.ShopType type = request.Get <App.Model.Master.MShopItem.ShopType>("type"); typeIndex = System.Array.FindIndex(types, t => t == type); ScrollViewSets(); yield return(0); }
public IEnumerator Buy(App.Model.Master.MShopItem mShopItem) { SShop sShop = new SShop(); yield return(StartCoroutine(sShop.RequestBuy("item", mShopItem.id))); }