示例#1
0
		public void Init(long uid, Item_Tbl tbl)
		{
			this.mGuid = uid;
			mTemplate = tbl;
			if (null == tbl)
				return;

			string[] comTypes = new string[]{mTemplate.component1, mTemplate.component2, mTemplate.component3,
				mTemplate.component4, mTemplate.component5, mTemplate.component6,
				mTemplate.component7, mTemplate.component8, mTemplate.component9, mTemplate.component10};

			string[] comParams = new string[]{mTemplate.componentParam1, mTemplate.componentParam2, mTemplate.componentParam3,
				mTemplate.componentParam4, mTemplate.componentParam5, mTemplate.componentParam6,
				mTemplate.componentParam7, mTemplate.componentParam8, mTemplate.componentParam9, mTemplate.componentParam10};

			for (int i = 0; i < ItemDefines.MaxComCount; ++i)
			{
				if (comTypes[i].Length <= 0)
					continue;
				var comp = gameObject.AddComponent(System.Type.GetType(comTypes[i])) as ItemBaseComponent;
				if (null == comp)
					continue;
				comp.Init(comParams[i], this);
				mComponentList.Add(comp);
			}
		}
示例#2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Item_Tbl item_tbl = await db.Item_Tbl.FindAsync(id);

            db.Item_Tbl.Remove(item_tbl);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#3
0
        public async Task <ActionResult> Edit([Bind(Include = "itemid,iname,idesc,itype,iimage,iprice,icategory,createdby,createddate,updatedby,updateddate")] Item_Tbl item_tbl)
        {
            if (ModelState.IsValid)
            {
                db.Entry(item_tbl).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(item_tbl));
        }
示例#4
0
    public void Init(long guid, int templateID, int count, int obainTime, int loss)
    {
        this.m_guid         = guid;
        this.m_templateID   = templateID;
        this.m_count        = count;
        this.m_obtainedTime = obainTime;
        this.m_loss         = loss;

        if (null == m_template || m_template.id != templateID)
        {
            m_template = TemplatePool.Instance.GetDataByKey <Item_Tbl>(this.m_templateID);
        }
    }
示例#5
0
        // GET: /Item/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Item_Tbl item_tbl = await db.Item_Tbl.FindAsync(id);

            if (item_tbl == null)
            {
                return(HttpNotFound());
            }
            return(View(item_tbl));
        }