public static ItemBase newInstance(ItemBase a) { VicisMod.log(LOGGER_PREFIX, "Creating new instance of " + a.GetDisplayString()); switch (a.mType) { case ItemType.ItemCubeStack: ItemCubeStack ics = a as ItemCubeStack; return(new ItemCubeStack(ics.mCubeType, ics.mCubeValue, ics.mnAmount)); case ItemType.ItemStack: ItemStack its = a as ItemStack; return(new ItemStack(its.mnItemID, its.mnAmount)); case ItemType.ItemCharge: ItemCharge ic = a as ItemCharge; return(new ItemCharge(ic.mnItemID, (int)ic.mChargeLevel)); case ItemType.ItemDurability: ItemDurability id = a as ItemDurability; return(new ItemDurability(id.mnItemID, id.mnCurrentDurability, id.mnMaxDurability)); case ItemType.ItemLocation: ItemLocation il = a as ItemLocation; return(new ItemLocation(il.mnItemID, il.mLocX, il.mLocY, il.mLocZ, il.mLookVector)); case ItemType.ItemSingle: return(new ItemSingle(a.mnItemID)); } return(null); }
public static ItemBase newInstance(ItemBase a) { switch (a.mType) { case ItemType.ItemCubeStack: ItemCubeStack ics = a as ItemCubeStack; return(new ItemCubeStack(ics.mCubeType, ics.mCubeValue, ics.mnAmount)); case ItemType.ItemStack: ItemStack its = a as ItemStack; return(new ItemStack(its.mnItemID, its.mnAmount)); case ItemType.ItemCharge: ItemCharge ic = a as ItemCharge; return(new ItemCharge(ic.mnItemID, (int)ic.mChargeLevel)); case ItemType.ItemDurability: ItemDurability id = a as ItemDurability; return(new ItemDurability(id.mnItemID, id.mnCurrentDurability, id.mnMaxDurability)); case ItemType.ItemLocation: ItemLocation il = a as ItemLocation; return(new ItemLocation(il.mnItemID, il.mLocX, il.mLocY, il.mLocZ, il.mLookVector)); case ItemType.ItemSingle: return(new ItemSingle(a.mnItemID)); } return(null); }
void Start() { ennemisDectetion = GetComponent <BoxCollider2D>(); centerRoom = transform.parent.GetComponentInParent <Transform>(); activeItemCharge = GameObject.Find("Perso").GetComponent <ItemCharge>(); Detection(); allEnnemiesDead = false; }
void Start() { attack = DoAttack; canAttack = true; animHandler = GetComponent <YT_PCAnimationHandler>(); itemCharge = GetComponent <ItemCharge>(); activeItem = GetComponentInChildren <ItemDetection>(); }
private void Start() { roomColor = GetComponentInParent <LeverTrigger>(); itemCharge = GameObject.Find("Perso").GetComponent <ItemCharge>(); activeItem = GameObject.Find("DetectionZone").GetComponent <ItemDetection>(); detectPlayer = GameObject.Find("EnnemisDetection").GetComponent <YT_RoomTransition>(); hiveMind = false; }
private void Start() { playerController = GameObject.Find("Perso").GetComponent <PlayerController>(); itemCharge = GetComponent <ItemCharge>(); activeItem = GetComponentInChildren <ItemDetection>(); Shoot = DoShoot; controller = GetComponent <PlayerController>(); }
void instantiateUIComponent() { chargeScript = GetComponentInParent <ItemCharge>(); itemCollider = GetComponent <CircleCollider2D>(); imgCacWepon = GameObject.Find("CacWeapon").GetComponent <Image>(); imgDistWeapon = GameObject.Find("DistWeapon").GetComponent <Image>(); activeObject = GameObject.Find("ActiveObject").GetComponent <Image>(); numberCoins = GameObject.Find("CurrentCoins").GetComponent <TMP_Text>(); imgIndex = 0; }
public ActionResult _AddItemCharge(ItemCharge mItemCharge) { if (ModelState.IsValid) { if (ExecuteRepositoryAction(() => { _itemChargeService.AddItemCharge(mItemCharge); _itemChargeService.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } } return(PartialView("_EditItemCharge", mItemCharge)); }
private static OneOffItem CreateOneOfItemFromPresetOneOffCharges(ItemCharge itemCharge, int quantity = 1) { return(new OneOffItem { Date = DateTime.Today, Description = itemCharge.Description, Charge = itemCharge.Amount, Quantity = quantity, OneOffTypeId = (int)OneOffTypes.Work }); }
public ActionResult _EditItemCharge(ItemCharge mItemCharge) { if (ModelState.IsValid) { var itemCharge = _itemChargeService.GetItemCharge(mItemCharge.ItemChargeId); if (TryUpdateModel(itemCharge)) { if (ExecuteRepositoryAction(() => { _itemChargeService.UpdateItemCharge(itemCharge); _itemChargeService.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } } } return(PartialView(mItemCharge)); }
public ActionResult _AddItemCharge() { var itemCharge = new ItemCharge(); return(PartialView("_EditItemCharge", itemCharge)); }
public static bool compareCharge(this ItemCharge a, ItemCharge b) { return(a != null && b != null && compareBase(a, b) && a.mChargeLevel == b.mChargeLevel); }
private void Start() { player = GameObject.FindGameObjectWithTag("Player"); activeItem = GetComponentInChildren <ItemDetection>(); itemCharge = GetComponent <ItemCharge>(); }
public void UpdateItemCharge(ItemCharge itemCharge) { _itemChargeRepository.Update(itemCharge); }
public void AddItemCharge(ItemCharge itemCharge) { _itemChargeRepository.Add(itemCharge); }
/// <summary> /// Compares ItemID, Type, and ChargeLevel of ItemCharge /// </summary> /// <param name="original">Original Item</param> /// <param name="comparer">Item to Compare Against</param> /// <returns>True if ItemID, Type and ChargeLevel of both Items match, otherwise false</returns> public static bool Compare(this ItemCharge original, ItemCharge comparer) { return(original != null && comparer != null && original.Compare(comparer.As <ItemBase>()) && FloatTolerance(original.mChargeLevel, comparer.mChargeLevel, 0.1f)); }