Esempio n. 1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.G))
     {
         _itemDatabase.AddItem(0, this);
     }
     else if (Input.GetKeyDown(KeyCode.T))
     {
         _itemDatabase.RemoveItem(0, this);
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         // only this means this Script class
         _ItemDB.AddItem(0, this);
     }
     if (Input.GetKeyDown(KeyCode.R))
     {
         _ItemDB.RemoveItem(0, this);
     }
 }
Esempio n. 3
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         // request item by ID
         _itemDatabase.AddItem(0, this);
     }
     else if (Input.GetKeyDown(KeyCode.R))
     {
         // remove item by ID
         _itemDatabase.RemoveItem(0, this);
     }
 }
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         //request item by ID
         //har code adding item 0
         _itemDatabase.AddItem(0, this);
         //future worK: cehck for avilable inventory slots
     }
     else if (Input.GetKeyDown(KeyCode.R))
     {
         //remove item by ID
         _itemDatabase.RemoveItem(0, this);
     }
 }
Esempio n. 5
0
        public ActionResult CreateItem()
        {
            ViewBag.Result = "Create Item";
            if (Request.HttpMethod.ToUpperInvariant() == "POST")
            {
                var item = new ItemInfo()
                {
                    Id          = Guid.NewGuid(),
                    Name        = Request.Form["name"],
                    Description = Request.Form["description"],
                    Link        = Request.Form["link"],
                    Image       = string.IsNullOrEmpty(Request.Form["image"]) ? "http://lorempixel.com/800/800?rand=" + DateTime.Now.Ticks.ToString() : Request.Form["image"],
                    CreatedUser = Request.Form["createdUser"],
                    CreatedTime = DateTime.Now,
                };
                ItemDB.AddItem(item);
            }

            return(View(ViewBag));
        }