public ActionResult Create([Bind(Include = "Id")] Pickups pickups) { if (ModelState.IsValid) { db.Pickups.Add(pickups); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pickups)); }
public async void AddPickup(Pickups pickup) { try { CollectionReference colRef = fireStoreDb.Collection("pickups"); await colRef.AddAsync(pickup); } catch { throw; } }
public async void UpdatePickup(Pickups pickup, string id) { try { Google.Cloud.Firestore.DocumentReference pickupRef = fireStoreDb.Collection("pickups").Document(id); await pickupRef.SetAsync(pickup, SetOptions.Overwrite); } catch { throw; } }
public ActionResult Create([Bind(Include = "PickUpId,EmployeeId,PickUpSuspensionBegins,PickUpSuspensionEnds,ExtraPickUp,PickUpCompleted,Charge,PickUpDay,ZipCode")] Pickups pickups) { if (ModelState.IsValid) { db.Pickups.Add(pickups); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "ApplicationUserId", pickups.EmployeeId); return(View(pickups)); }
public void HandlePickup(Pickups p) { if (p is PowerPickups) { Debug.Log("Adding Power: " + p.getName()); addToPowerSet((PowerPickups)p); } else { Debug.Log("Adding Inventory Item " + p.getName()); } inventoryList.Add(p); }
// GET: Pickups/Create public ActionResult Create(int id) { var Pickup = new Pickups(); var customer = db.Customers.Where(c => c.CustomerId == id).FirstOrDefault(); Pickup.CustomerId = customer.CustomerId; Pickup.Customer = customer; Pickup.PickupCost = 50.00; Pickup.Repeat = true; Pickup.Zipcode = customer.ZipCode; return(View(Pickup)); }
public void UnregisterPickup(TargetObject pickupCollected) { if (pickupCollected.gameMode != gameMode) { return; } // removes the pickup from the list, so that we can keep track of how many are left on the map if (pickupCollected.gameMode == GameMode.Laps) { pickupCollected.active = false; LapObject lapObject = (LapObject)pickupCollected; if (!lapObject.finishLap) { return; //Si el objeto no es la linea de meta no ejecuta las siguientes lineas } if (!lapObject.lapOverNextPass) //La primera vez que pasa por linea de meta, actualiza las vueltas e incia el tiempo { TimeDisplay.OnUpdateLap(); if (configuration.activeObjects) { textRank.gameObject.SetActive(true); } Item.SetActive(true); lapObject.lapOverNextPass = true; return; } if (NumberOfActivePickupsRemaining() != 0) { return; } ReachCheckpoint(0, isTimed, lapObject.TimeGained); ResetPickups(); TimeDisplay.OnUpdateLap(); if (isTimed) { TimeManager.OnAdjustTime(lapObject.TimeGained); } } else { ReachCheckpoint(NumberOfPickupsRemaining - 1, isTimed, 0); Pickups.Remove(pickupCollected); if (gameMode == GameMode.Laps) { KartGame.Track.TimeDisplay.OnUpdateLap(); } } }
public void SpawnDropped() { List <DroppedItemData> junk = new List <DroppedItemData>(); foreach (DroppedItemData d in droppedItems) { if (d.scene.Equals(SceneManager.GetActiveScene().name)) { DroppedItemData temp = d; GameObject go = new GameObject { name = d.item.name }; SpriteRenderer sr = go.AddComponent <SpriteRenderer>(); sr.sprite = Resources.Load <Sprite>(d.item.imagePath); go.transform.position = new Vector3(d.x, d.y, d.z); Vector2 bounds = new Vector2(sr.bounds.size.x, sr.bounds.size.y); BoxCollider2D c = go.AddComponent <BoxCollider2D>(); c.size = bounds; c.isTrigger = true; if (!(d.item is Potion)) { if (d.item.imagePath.StartsWith("Gem")) { go.transform.localScale = new Vector3(0.7f, 0.7f, 1); } else if (go.name.Equals("algae") || go.name.Equals("snail")) { go.transform.localScale = new Vector3(0.6f, 0.6f, 1); } else { go.transform.localScale = new Vector3(0.4f, 0.4f, 1); } } Pickups p = go.AddComponent <Pickups>(); p.Item = d.item; p.Count = d.count; p.Data = temp; junk.Add(temp); } else { junk.Add(d); } } droppedItems = junk; }
// GET: Customer/Edit/5 public ActionResult Edit(int id) { Pickups pickupFromDB = context.Pickups.Where(p => p.ID == id).FirstOrDefault(); ViewBag.States = new SelectList(context.States.Where(s => s.StateAbbrivation.Contains(s.StateAbbrivation)).ToList(), "ID", "StateAbbrivation"); List <string> days = new List <string>() { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; ViewBag.Days = new SelectList(days); return(View("EditPickup", pickupFromDB)); }
private void InitializeVariables() { playerGo = new GameObject[numberOfPlayersInGame]; e_playerPickups = new Pickups[numberOfPlayersInGame]; i_tempBombAmount = new int[numberOfPlayersInGame]; f_RCBombTimer = new float[numberOfPlayersInGame]; //Initialize player default pickups for (int i = 0; i < numberOfPlayersInGame; i++) { e_playerPickups[i] = new Pickups(1, 1, 1, false); i_tempBombAmount[i] = 1; } f_levelTime = GameEventManager.levelTime; }
// GET: Pickups/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pickups pickups = db.Pickups.Find(id); if (pickups == null) { return(HttpNotFound()); } return(View(pickups)); }
// GET: Pickups/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pickups pickups = db.Pickups.Find(id); if (pickups == null) { return(HttpNotFound()); } ViewBag.EmployeeId = new SelectList(db.Employees, "EmployeeId", "ApplicationUserId", pickups.EmployeeId); return(View(pickups)); }
public ActionResult Delete(int id, Pickups pickup) { try { Pickups pickupFromDb = context.Pickups.Where(p => p.ID == pickup.ID).FirstOrDefault(); context.Pickups.Remove(pickupFromDb); context.SaveChanges(); return(RedirectToAction("PickupList")); } catch { return(View()); } }
// GET: Pickups/Details/5 public ActionResult Details(int?id) { //Employees employee = db.Employees.Where(e => e.EmployeeId == User.Identity.Name) if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pickups pickups = db.Pickups.Find(id); if (pickups == null) { return(HttpNotFound()); } return(View(pickups)); }
public void enableIcon(Pickups pickup) { int index = (int)pickup; if (activeIndex != index) { pickupIcon[index].SetActive(true); activeIndex = index; } else if (activeIndex > -1) { pickupIcon[index].SetActive(true); activeIndex = index; } }
// GET: Pickups/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pickups pickups = db.Pickups.Find(id); if (pickups == null) { return(HttpNotFound()); } ViewBag.CustomerId = new SelectList(db.Customers, "CustomersId", "Username", pickups.CustomerId); return(View(pickups)); }
public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { //we do a CONSIDERABLE amount of trolling. contentPack.artifactDefs.Add(Artifacts.DumpContent()); //args.ReportProgress(1f); contentPack.bodyPrefabs.Add(Bodies.DumpContent()); //args.ReportProgress(1f); contentPack.buffDefs.Add(Buffs.DumpContent()); //args.ReportProgress(1f); contentPack.effectDefs.Add(Effects.DumpContent()); //args.ReportProgress(1f); contentPack.eliteDefs.Add(Elites.DumpContent()); //args.ReportProgress(1f); contentPack.gameEndingDefs.Add(GameEndings.DumpContent()); //args.ReportProgress(1f); contentPack.entityStateConfigurations.Add(Loadouts.DumpConfigs()); //args.ReportProgress(1f); contentPack.entityStateTypes.Add(Loadouts.DumpEntityStates()); //args.ReportProgress(1f); contentPack.skillFamilies.Add(Loadouts.DumpContentSkillFamilies()); //args.ReportProgress(1f); contentPack.skillDefs.Add(Loadouts.DumpContentSkillDefs()); //args.ReportProgress(1f); contentPack.survivorDefs.Add(Loadouts.DumpSurvivorDefs()); //args.ReportProgress(1f); contentPack.masterPrefabs.Add(Masters.DumpContent()); //args.ReportProgress(1f); contentPack.musicTrackDefs.Add(MusicTracks.DumpContent()); //args.ReportProgress(1f); contentPack.networkedObjectPrefabs.Add(NetworkPrefabs.DumpContent()); //args.ReportProgress(1f); contentPack.networkSoundEventDefs.Add(NetworkSoundEvents.DumpContent()); //args.ReportProgress(1f); contentPack.itemDefs.Add(Pickups.DumpContentItems()); //args.ReportProgress(1f); contentPack.equipmentDefs.Add(Pickups.DumpContentEquipment()); //args.ReportProgress(1f); contentPack.projectilePrefabs.Add(Projectiles.DumpContent()); //args.ReportProgress(1f); contentPack.gameModePrefabs.Add(Runs.DumpContent()); //args.ReportProgress(1f); contentPack.sceneDefs.Add(Scenes.DumpContent()); //args.ReportProgress(1f); contentPack.surfaceDefs.Add(SurfaceDefinitions.DumpContent()); args.ReportProgress(1f); yield break; }
public ActionResult DeleteConfirmed(int id) { Pickups pickups = db.Pickups.Find(id); db.Pickups.Remove(pickups); db.SaveChanges(); if (User.IsInRole("Employee")) { return(RedirectToAction("Index")); } else { return(RedirectToAction("Home", "Customer", null)); } }
public bool Equals(SaveFileIV other) { if (other == null) { return(false); } return(Name.Equals(other.Name) && TimeStamp.Equals(other.TimeStamp) && SaveVersion.Equals(other.SaveVersion) && SaveSizeInBytes.Equals(other.SaveSizeInBytes) && ScriptSpaceSize.Equals(other.ScriptSpaceSize) && SimpleVars.Equals(other.SimpleVars) && PlayerInfo.Equals(other.PlayerInfo) && ExtraContent.Equals(other.ExtraContent) && Scripts.Equals(other.Scripts) && Garages.Equals(other.Garages) && GameLogic.Equals(other.GameLogic) && Paths.Equals(other.Paths) && Pickups.Equals(other.Pickups) && RestartPoints.Equals(other.RestartPoints) && RadarBlips.Equals(other.RadarBlips) && Zones.Equals(other.Zones) && GangData.Equals(other.GangData) && CarGenerators.Equals(other.CarGenerators) && Stats.Equals(other.Stats) && IplStore.Equals(other.IplStore) && StuntJumps.Equals(other.StuntJumps) && Radio.Equals(other.Radio) && Objects.Equals(other.Objects) && Relationships.Equals(other.Relationships) && Inventory.Equals(other.Inventory) && UnusedPools.Equals(other.UnusedPools) && UnusedPhoneInfo.Equals(other.UnusedPhoneInfo) && UnusedAudioScript.Equals(other.UnusedAudioScript) && UnusedSetPieces.Equals(other.UnusedSetPieces) && UnusedStreaming.Equals(other.UnusedStreaming) && UnusedPedTypeInfo.Equals(other.UnusedPedTypeInfo) && UnusedTags.Equals(other.UnusedTags) && UnusedShopping.Equals(other.UnusedShopping) && UnusedGangWars.Equals(other.UnusedGangWars) && UnusedEntryExits.Equals(other.UnusedEntryExits) && Unused3dMarkers.Equals(other.Unused3dMarkers) && UnusedVehicles.Equals(other.UnusedVehicles) && UnusedExtraBlock.Equals(other.UnusedExtraBlock) && GfwlData.Equals(other.GfwlData)); }
private void OnTriggerStay2D(Collider2D collision) { if (collision.gameObject.tag == "Pickups") { if (Input.GetKeyDown(KeyCode.E)) { Pickups curPickup = collision.GetComponent <Pickups>(); switch (curPickup.currentCollectible) { case Pickups.CollectibleType.BOMB: Destroy(collision.gameObject); break; } } } }
public ItemManager() { for (int i = 1; i <= 25; i++) { Pickup pickup = new Pickup(i); pickup.PropertyChanged += PickupOnPropertyChanged; Pickups.Add(pickup); } foreach (var item_entry in ItemNames) { int id = item_entry.Key; string name = item_entry.Value; string description = ItemDescriptions[id]; Items.Add(new Item(id, name, description)); } }
public static Pickup CreatePickup(Vector2 position, Vector2 targetPosition, Pickups type, int playerIndex) { Pickup pickup; if ((int)type > 20) { Type ctype = ModPickupTypes[(int)type]; pickup = (Pickup)ctype.GetConstructor(ModPickupArgs).Invoke(new object[3] { position, targetPosition, playerIndex }); } else { pickup = orig_CreatePickup(position, targetPosition, type, playerIndex); } return(pickup); }
void OnTriggerStay2D(Collider2D collision) { if (collision.gameObject.tag == "Pickups") { Pickups curPickup = collision.GetComponent <Pickups>(); if (Input.GetKeyDown(KeyCode.E)) { switch (curPickup.currentCollectible) { case Pickups.CollectibleType.KEY: //add to inventory or other mechanic Destroy(collision.gameObject); break; } } } }
/* this can be used for storing collectables */ private void OnTriggerStay2D(Collider2D collision) // if we stay in the trigger { if (collision.gameObject.tag == "Pickups") { if (Input.GetKeyDown(KeyCode.E)) // if you press E { Pickups curPickup = collision.GetComponent <Pickups>(); switch (curPickup.currentCollectible) { case Pickups.CollectibleType.KEY: // if we are the key /* can add to inventory or other mechanic */ Destroy(collision.gameObject); break; } } } }
private void SpawnPickups() { foreach (Vector2 cell in Pickups.GetUsedCells()) { int id = Pickups.GetCellv(cell); string type = Pickups.TileSet.TileGetName(id); if (type.ToLower() == "gem" || type.ToLower() == "cherry") { GD.Print(type); Collectible c = (Collectible)Collectible.Instance(); Vector2 pos = Pickups.MapToWorld(cell); c.Init(type, pos + Pickups.CellSize / 2); AddChild(c); c.Connect("Pickup", this, "_on_Collectible_Pickup"); } } }
public ActionResult CompletePickup([Bind(Include = "PickupId,PickupWeekDay,PickupDate,CustomerId,Zipcode,Repeat,IsCompleted,CompleteTime,PickupCost")] Pickups pickups) { pickups.IsCompleted = true; pickups.CompleteTime = DateTime.Now; if (ModelState.IsValid) { db.Entry(pickups).State = EntityState.Modified; db.SaveChanges(); if (User.IsInRole("Employee")) { return(RedirectToAction("ApplyCustomerFee", "Customer", new { id = pickups.CustomerId })); } } return(View(pickups)); }
public void UnregisterPickup(TargetObject pickupCollected) { if (pickupCollected.gameMode != gameMode) { return; } // removes the pickup from the list, so that we can keep track of how many are left on the map if (pickupCollected.gameMode == GameMode.Laps) { pickupCollected.active = false; LapObject lapObject = (LapObject)pickupCollected; if (!lapObject.finishLap) { return; } if (!lapObject.lapOverNextPass) { TimeDisplay.OnUpdateLap(); lapObject.lapOverNextPass = true; return; } if (NumberOfActivePickupsRemaining() != 0) { return; } ReachCheckpoint(0); ResetPickups(); TimeDisplay.OnUpdateLap(); } else { ReachCheckpoint(NumberOfPickupsRemaining - 1); Pickups.Remove(pickupCollected); if (gameMode == GameMode.Laps) { KartGame.Track.TimeDisplay.OnUpdateLap(); } } }
void HandleOnPickup(Pickups type) { if (type == Pickups.Health) { if (hp == maxHitPoints) { return; } hp += hpGainedOnPickup; if (hp > maxHitPoints) { hp = maxHitPoints; } OnHpChange?.Invoke(hp, maxHitPoints); } }
public void RemovePickups(IEnumerable <Pickup> pickups) { foreach (Pickup pickup in pickups) { if (pickup.Amount == 0) { continue; } Pickup existing = Pickups.FirstOrDefault(p => p.Id == pickup.Id); if (existing == null) { continue; } existing.Amount -= pickup.Amount; } }
public static void DropItem(InventorySlot slot) { Vector3 tempPos = GameObject.FindGameObjectWithTag("Player").transform.position; Vector3 offset = new Vector3(Random.Range(-1, 1), Random.Range(-1, 0.3f), 0); GameObject go = new GameObject(); go.name = slot.item.item.name; SpriteRenderer sr = go.AddComponent <SpriteRenderer>(); sr.sprite = Resources.Load <Sprite>(slot.item.item.imagePath); sr.sortingLayerName = "InFrontOfPlayer"; sr.sortingOrder = 10; go.transform.position = GameObject.FindGameObjectWithTag("Player").transform.position + offset; Vector2 bounds = new Vector2(sr.bounds.size.x, sr.bounds.size.y); BoxCollider2D c = go.AddComponent <BoxCollider2D>(); c.size = bounds; c.isTrigger = true; if (!(slot.item.item is Potion)) { if (slot.item.item.imagePath.StartsWith("Gem")) { go.transform.localScale = new Vector3(0.7f, 0.7f, 1); } else if (go.name.Equals("algae") || go.name.Equals("snail")) { go.transform.localScale = new Vector3(0.6f, 0.6f, 1); } else { go.transform.localScale = new Vector3(0.4f, 0.4f, 1); } } Pickups p = go.AddComponent <Pickups>(); p.Item = slot.item.item; p.Count = slot.item.count; p.Data = new GarbageCollecter.DroppedItemData(slot.item.item, slot.item.count, go.transform.position.x, go.transform.position.y, go.transform.position.z, UnityEngine.SceneManagement.SceneManager.GetActiveScene().name); GameObject.Find("GarbageCollector").GetComponent <GarbageCollecter>().droppedItems.Add(p.Data); RemoveStack(slot); }
public int CreatePickup(Vector3 pos, Vector3 rot, int pickupHash, int amount, int netHandle) { var newPickup = Function.Call <int>(Hash.CREATE_PICKUP_ROTATE, pickupHash, pos.X, pos.Y, pos.Z, rot.X, rot.Y, rot.Z, 512, amount, 0, true, 0); lock (HandleMap) HandleMap.Add(netHandle, newPickup); lock (Pickups) Pickups.Add(newPickup); var start = 0; while (Function.Call <int>(Hash.GET_PICKUP_OBJECT, newPickup) == -1 && start < 20) { start++; Script.Yield(); } new Prop(Function.Call <int>(Hash.GET_PICKUP_OBJECT, newPickup)).FreezePosition = true; new Prop(Function.Call <int>(Hash.GET_PICKUP_OBJECT, newPickup)).IsPersistent = true; return(newPickup); }