Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
    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 ");
    }
Esempio n. 4
0
        public StationPage(StopItem stop)
        {
            InitializeComponent();
            SetBindings();

            Title = stop.Stop;

            LoadingIndicator.IsVisible = true;
            LoadingIndicator.IsRunning = true;
            GetTrains("stazione", stop.Stop);
        }
Esempio n. 5
0
        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));
        }