Beispiel #1
0
        public async Task <ActionResult <SShop> > PostSShop(SShop sShop)
        {
            _context.SShops.Add(sShop);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSShop", new { id = sShop.Id }, sShop));
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public IEnumerator Buy(App.Model.Master.MShopItem mShopItem)
        {
            SShop sShop = new SShop();

            yield return(StartCoroutine(sShop.RequestBuy("item", mShopItem.id)));
        }