public static void Copy(UnturnedPlayer fromPlayer, UnturnedPlayer toPlayer, bool clothes) { PlayerClothing clothing = fromPlayer.Player.clothing; Hat hat = new Hat(clothing.hat, clothing.hatQuality, clothing.hatState); Mask mask = new Mask(clothing.mask, clothing.maskQuality, clothing.maskState); Shirt shirt = new Shirt(clothing.shirt, clothing.shirtQuality, clothing.shirtState); Vest vest = new Vest(clothing.vest, clothing.vestQuality, clothing.vestState); Backpack backpack = new Backpack(clothing.backpack, clothing.backpackQuality, clothing.backpackState); Pants pants = new Pants(clothing.pants, clothing.pantsQuality, clothing.pantsState); Clothing clothesList = new Clothing(hat, mask, shirt, vest, backpack, pants); List <Item> itemList = ListItems(fromPlayer); int inventoryCount = itemList.Count; Clear(toPlayer, clothes); if (clothes == true) { AddClothing(toPlayer, backpack, clothesList); } else { AddClothing(toPlayer, backpack); } for (int i = 0; i < itemList.Count; i++) { AddItem(toPlayer, itemList[i]); } }
// Start is called before the first frame update void Start() { text.GetComponent <Text>().text = ""; shield = new Shield(); sword = new Sword(); vest = new Vest(); }
public ActionResult CreateVest(Vest vest) { vest.CratedDate = DateTime.Now; db.Vesti.Add(vest); db.SaveChanges(); return(RedirectToAction("Index", "Home")); }
public Clothing(Hat hat, Mask mask, Shirt shirt, Vest vest, Backpack backpack, Pants pants) { this.hat = hat; this.mask = mask; this.shirt = shirt; this.vest = vest; this.backpack = backpack; this.pants = pants; }
public ActionResult UpdateVest(Vest vest) { var d = db.Vesti.Where(s => s.Id == vest.Id).First(); d.Name = vest.Name; d.Description = vest.Description; d.Author = vest.Author; d.Category = vest.Category; db.SaveChanges(); return(RedirectToAction("Index", "Home")); }
//[HttpPost] public ActionResult Delete(int id) { try { Vest vest = db.Vesti.Where(s => s.Id == id).First(); db.Vesti.Remove(vest); db.SaveChanges(); return(RedirectToAction("Index", "Home")); } catch (System.Exception) { return(View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier })); } }
public static void AddClothing(UnturnedPlayer player, Backpack backpack, Clothing clothing = null) { if (clothing != null) { Hat hat = clothing.hat; Mask mask = clothing.mask; Shirt shirt = clothing.shirt; Vest vest = clothing.vest; Pants pants = clothing.pants; Glasses glasses = clothing.glasses; if (hat != null) { player.Player.clothing.askWearHat(hat.id, hat.quality, hat.state, true); } if (mask != null) { player.Player.clothing.askWearMask(mask.id, mask.quality, mask.state, true); } if (shirt != null) { player.Player.clothing.askWearShirt(shirt.id, shirt.quality, shirt.state, true); } if (vest != null) { player.Player.clothing.askWearVest(vest.id, vest.quality, vest.state, true); } if (pants != null) { player.Player.clothing.askWearPants(pants.id, pants.quality, pants.state, true); } if (glasses != null) { player.Player.clothing.askWearGlasses(glasses.id, pants.quality, pants.state, true); } } if (backpack != null) { player.Player.clothing.askWearBackpack(backpack.id, backpack.quality, backpack.state, true); } }
public string printVestNumber() { return(Vest.ToString()); }