void UnpackUpgrade(string upgrade, Dictionary <string, StopItem> allItems) { StopItem item = allItems [upgrade]; item.currentLevel = PlayerPrefs.GetInt(upgrade, 0); allItems [upgrade] = item; print("Unpacking " + item.upgradeString + " with level " + item.currentLevel); // apply upgrade effect if (upgrade == "tank") { // oxygen tank PlayerController.instance.SetTankMultiplier(item.currentLevel, item.costs.Length); } else if (upgrade == "reach") { // reach PlayerController.instance.SetReachMultiplier(item.currentLevel, item.costs.Length); } else if (upgrade == "patches") { // patches PlayerController.instance.SetPatches(item.currentLevel); } else if (upgrade == "recovery") { // recovery PlayerController.instance.SetRecovery(item.currentLevel, item.costs.Length); } }
public async Task <IActionResult> PutStopItem([FromRoute] string id, [FromBody] StopItem stopItem) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != stopItem.stop_id) { return(BadRequest()); } _context.Entry(stopItem).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StopItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
void UnpackEquipedWeapon() { string weapon = PlayerPrefs.GetString("weapon", "pistol"); StopItem item = allShopItems[weapon]; item.equiped = true; allShopItems [weapon] = item; print("Unpacking " + item.upgradeString + " as equiped weapon "); }
public StationPage(StopItem stop) { InitializeComponent(); SetBindings(); Title = stop.Stop; LoadingIndicator.IsVisible = true; LoadingIndicator.IsRunning = true; GetTrains("stazione", stop.Stop); }
public async Task <IActionResult> PostStopItem([FromBody] StopItem stopItem) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Stops.Add(stopItem); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStopItem", new { id = stopItem.stop_id }, stopItem)); }