/// <summary> /// Kiểm tra và thêm mới Im /// </summary> /// <param name="entity">Entity</param> /// <returns>Int32: ID của Im Mới Thêm Vào</returns> public static Int32 Add(ImEntity entity) { checkLogic(entity); checkDuplicate(entity, false); checkFK(entity); return ImDAL.Add(entity); }
public void TestLowerHealth(ImEntity entity) { if (entity.HealthComponent() != null) { entity.HealthComponent().currentHealth -= 10f; } }
public void TestRaiseHealth(ImEntity entity) { if (entity.HealthComponent() != null) { entity.HealthComponent().currentHealth += 10f; } }
/// <summary> /// Kiểm tra và chỉnh sửa Im /// </summary> /// <param name="entity">ImEntity</param> /// <returns>bool:kết quả thực hiện</returns> public static bool Edit(ImEntity entity) { checkExist(entity._id); checkLogic(entity); checkDuplicate(entity, true); checkFK(entity); return ImDAL.Edit(entity); }
public void Show(List <ImAbstractItem> inventory, ImEntity correspondingEntity) { isShowing = true; this.isVisible = true; this.correspondingEntity = correspondingEntity; if (SignalNeedsInventoryRefresh != null) { SignalNeedsInventoryRefresh(this); } }
public void Dismiss() { isShowing = false; this.isVisible = false; for (int i = tableCells.Count - 1; i >= 0; i--) { ImTableCell cell = tableCells[i]; RemoveTableCell(cell); } correspondingEntity = null; }
public bool HandleSingleTouchBegan(FTouch touch) { ImNode touchedNode = null; foreach (ImEntity entity in nodeLayer.entities) { ImNode node = entity as ImNode; if (node.ContainsGlobalPoint(touch.position)) { touchedNode = node; } } foreach (ImEntity entity in nodeLayer.entities) { ImNode node = entity as ImNode; if (node.ContainsGlobalPoint(touch.position)) { touchedNode = node; } } if (touchedNode != null && !pop.isShowing) { pop.Show(inventory, touchedNode); } if (pop != null) { if (pop.HandleTouchBegan(touch)) { currentEntityWithFocus = pop; } } return(true); }
public virtual void PerformActionOnEntity(ImEntity targetEntity) { }
public virtual bool CanBeUsedOnEntity(ImEntity targetEntity) { return true; }
public void UseItem(ImEntity targetEntity) { item.PerformActionOnEntity(targetEntity); }
public void TestShrinkSprite(ImEntity entity) { entity.RadialWipeSpriteComponents()[0].sprite.scale /= 2f; }
public override bool CanBeUsedOnEntity(ImEntity targetEntity) { return targetEntity.HealthComponent() != null && targetEntity.HealthComponent().currentHealth > 0; }
/// <summary> /// Kiểm tra logic Entity /// </summary> /// <param name="entity">ImEntity: entity</param> private static void checkLogic(ImEntity entity) { //if (String.IsNullOrEmpty(entity.sLastname)) // throw new Exception(EX_SLASTNAME_EMPTY); }
public override void PerformActionOnEntity(ImEntity entity) { entity.HealthComponent().currentHealth += healthRefill_; }
public void HandleSingleTouchCanceled(FTouch touch) { currentEntityWithFocus = null; }
override public bool CanBeUsedOnEntity(ImEntity targetEntity) { return(targetEntity.HealthComponent() != null && targetEntity.HealthComponent().currentHealth > 0); }
override public void PerformActionOnEntity(ImEntity entity) { entity.HealthComponent().currentHealth -= poisonPower_; }
override public void PerformActionOnEntity(ImEntity entity) { entity.HealthComponent().currentHealth += healthRefill_; }
public void Show(List<ImAbstractItem> inventory, ImEntity correspondingEntity) { isShowing = true; this.isVisible = true; this.correspondingEntity = correspondingEntity; if (SignalNeedsInventoryRefresh != null) SignalNeedsInventoryRefresh(this); }
public bool HandleSingleTouchBegan(FTouch touch) { ImNode touchedNode = null; foreach (ImEntity entity in nodeLayer.entities) { ImNode node = entity as ImNode; if (node.ContainsGlobalPoint(touch.position)) { touchedNode = node; } } foreach (ImEntity entity in nodeLayer.entities) { ImNode node = entity as ImNode; if (node.ContainsGlobalPoint(touch.position)) { touchedNode = node; } } if (touchedNode != null && !pop.isShowing) pop.Show(inventory, touchedNode); if (pop != null) { if (pop.HandleTouchBegan(touch)) { currentEntityWithFocus = pop; } } return true; }
/// <summary> /// Kiểm tra tồn tại khóa ngoại /// </summary> /// <param name="entity">ImEntity:entity</param> private static void checkFK(ImEntity entity) { }
virtual public void PerformActionOnEntity(ImEntity targetEntity) { }
public void HandleSingleTouchEnded(FTouch touch) { currentEntityWithFocus = null; }
public void TestEnlargeSprite(ImEntity entity) { entity.RadialWipeSpriteComponents()[0].sprite.scale *= 2f; }
/// <summary> /// Kiểm tra trùng lặp bản ghi /// </summary> /// <param name="entity">ImEntity: ImEntity</param> private static void checkDuplicate(ImEntity entity,bool checkPK) { /* Example List<ImEntity> list = ImDAL.GetAll(); if (list.Exists( delegate(ImEntity oldEntity) { bool result =oldEntity.FIELD.Equals(entity.FIELD, StringComparison.OrdinalIgnoreCase); if(checkPK) result=result && oldEntity.PK_iImID != entity.PK_iImID; return result; } )) { list.Clear(); throw new Exception(EX_FIELD_EXISTED); } */ }
virtual public bool CanBeUsedOnEntity(ImEntity targetEntity) { return(true); }
public void TestLowerHealth(ImEntity entity) { if (entity.HealthComponent() != null) entity.HealthComponent().currentHealth -= 10f; }
public override void PerformActionOnEntity(ImEntity entity) { entity.HealthComponent().currentHealth -= poisonPower_; }
public void TestRaiseHealth(ImEntity entity) { if (entity.HealthComponent() != null) entity.HealthComponent().currentHealth += 10f; }