private void AddFishtypes() { Fishtype walleye = new Fishtype(); walleye.FishtypeName = "Walleye"; _context.AddFishtype(walleye); Fishtype trout = new Fishtype(); trout.FishtypeName = "Trout"; _context.AddFishtype(trout); Fishtype rainbowTrout = new Fishtype(); rainbowTrout.FishtypeName = "Rainbow Trout"; _context.AddFishtype(rainbowTrout); Fishtype musky = new Fishtype(); musky.FishtypeName = "Muskellunge"; _context.AddFishtype(musky); Fishtype pike = new Fishtype(); pike.FishtypeName = "Northern Pike"; _context.AddFishtype(pike); Fishtype largeMouth = new Fishtype(); largeMouth.FishtypeName = "Largemouth Bass"; _context.AddFishtype(largeMouth); Fishtype smallMouth = new Fishtype(); smallMouth.FishtypeName = "Smallmouth Bass"; _context.AddFishtype(smallMouth); Fishtype rock = new Fishtype(); rock.FishtypeName = "Rock Bass"; _context.AddFishtype(rock); Fishtype panFish = new Fishtype(); panFish.FishtypeName = "PanFish"; _context.AddFishtype(panFish); Fishtype yellowPerch = new Fishtype(); yellowPerch.FishtypeName = "Yellow Perch"; _context.AddFishtype(yellowPerch); Fishtype blackCrappie = new Fishtype(); blackCrappie.FishtypeName = "Black Crappie"; _context.AddFishtype(blackCrappie); }
public IActionResult CreateFishtype(Fishtype fishtype) { if (ModelState.IsValid == true) { _repository.AddFishtype(fishtype); return(RedirectToAction("Fishtypes")); } return(View(fishtype)); }
private void catchFish(Client player) { IEnumerable <Fishtype> PossibleFish = FishTypes.Where(f => f.FishLoc.Equals(getPlayerFishingLoc(player))); int chance = (int)(API.random() * 100); Fishtype CaughtFish = PossibleFish.Where(f => f.Rarity <= chance).FirstOrDefault(); if (CaughtFish != null) { if (CaughtFish.MinWeight != 0) { API.SendInfoNotification(player, "Seems like you caught something, reel it in, quick! ((Tap left/right))"); int weight = CaughtFish.MinWeight + (int)(API.random() * (CaughtFish.MaxWeight - CaughtFish.MinWeight + 1)); API.playPlayerAnimation(player, (int)((1 << 0)), "amb@world_human_stand_fishing@idle_a", "idle_c"); API.triggerClientEvent(player, "catchFish", weight, CaughtFish.FishName); Player user = Player.PlayerData[player]; user.NewFishWeight = weight; user.NewFish = CaughtFish; API.delay(5000, true, () => { user = Player.PlayerData[player]; if (!user.CaughtFish) { API.SendInfoNotification(player, "The fish got away."); stopfish(player); } else { user.CaughtFish = false; } }); } else { API.SendInfoNotification(player, "Nothing seems to nibble on your rod."); stopfish(player); } } else { API.SendErrorNotification(player, "Something went wrong, please submit a bug report."); stopfish(player); } }
public void AddFishtype(Fishtype fishtype) { Fishtypes.Add(fishtype); SaveChanges(); }
public void AddFishtype(Fishtype fishtype) { fishtype.FishtypeID = 5; _fishtypes.Add(fishtype); }