Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 public void TestLowerHealth(ImEntity entity)
 {
     if (entity.HealthComponent() != null)
     {
         entity.HealthComponent().currentHealth -= 10f;
     }
 }
Ejemplo n.º 3
0
 public void TestRaiseHealth(ImEntity entity)
 {
     if (entity.HealthComponent() != null)
     {
         entity.HealthComponent().currentHealth += 10f;
     }
 }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 public void Show(List <ImAbstractItem> inventory, ImEntity correspondingEntity)
 {
     isShowing                = true;
     this.isVisible           = true;
     this.correspondingEntity = correspondingEntity;
     if (SignalNeedsInventoryRefresh != null)
     {
         SignalNeedsInventoryRefresh(this);
     }
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
    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);
    }
Ejemplo n.º 8
0
 public virtual void PerformActionOnEntity(ImEntity targetEntity)
 {
 }
Ejemplo n.º 9
0
 public virtual bool CanBeUsedOnEntity(ImEntity targetEntity)
 {
     return true;
 }
Ejemplo n.º 10
0
 public void UseItem(ImEntity targetEntity)
 {
     item.PerformActionOnEntity(targetEntity);
 }
Ejemplo n.º 11
0
 public void TestShrinkSprite(ImEntity entity)
 {
     entity.RadialWipeSpriteComponents()[0].sprite.scale /= 2f;
 }
Ejemplo n.º 12
0
 public override bool CanBeUsedOnEntity(ImEntity targetEntity)
 {
     return targetEntity.HealthComponent() != null && targetEntity.HealthComponent().currentHealth > 0;
 }
Ejemplo n.º 13
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);
 }
Ejemplo n.º 14
0
 public void TestShrinkSprite(ImEntity entity)
 {
     entity.RadialWipeSpriteComponents()[0].sprite.scale /= 2f;
 }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 16
0
 public override void PerformActionOnEntity(ImEntity entity)
 {
     entity.HealthComponent().currentHealth += healthRefill_;
 }
Ejemplo n.º 17
0
 public void HandleSingleTouchCanceled(FTouch touch)
 {
     currentEntityWithFocus = null;
 }
Ejemplo n.º 18
0
 override public bool CanBeUsedOnEntity(ImEntity targetEntity)
 {
     return(targetEntity.HealthComponent() != null && targetEntity.HealthComponent().currentHealth > 0);
 }
Ejemplo n.º 19
0
 override public void PerformActionOnEntity(ImEntity entity)
 {
     entity.HealthComponent().currentHealth -= poisonPower_;
 }
Ejemplo n.º 20
0
 override public void PerformActionOnEntity(ImEntity entity)
 {
     entity.HealthComponent().currentHealth += healthRefill_;
 }
Ejemplo n.º 21
0
 public void UseItem(ImEntity targetEntity)
 {
     item.PerformActionOnEntity(targetEntity);
 }
Ejemplo n.º 22
0
 public void Show(List<ImAbstractItem> inventory, ImEntity correspondingEntity)
 {
     isShowing = true;
     this.isVisible = true;
     this.correspondingEntity = correspondingEntity;
     if (SignalNeedsInventoryRefresh != null) SignalNeedsInventoryRefresh(this);
 }
Ejemplo n.º 23
0
    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;
    }
Ejemplo n.º 24
0
 /// <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)
 {
 }
Ejemplo n.º 25
0
 virtual public void PerformActionOnEntity(ImEntity targetEntity)
 {
 }
Ejemplo n.º 26
0
 public void HandleSingleTouchEnded(FTouch touch)
 {
     currentEntityWithFocus = null;
 }
Ejemplo n.º 27
0
 public void TestEnlargeSprite(ImEntity entity)
 {
     entity.RadialWipeSpriteComponents()[0].sprite.scale *= 2f;
 }
Ejemplo n.º 28
0
 /// <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);
     }
     */
 }
Ejemplo n.º 29
0
 public void TestEnlargeSprite(ImEntity entity)
 {
     entity.RadialWipeSpriteComponents()[0].sprite.scale *= 2f;
 }
Ejemplo n.º 30
0
 virtual public bool CanBeUsedOnEntity(ImEntity targetEntity)
 {
     return(true);
 }
Ejemplo n.º 31
0
 public void TestLowerHealth(ImEntity entity)
 {
     if (entity.HealthComponent() != null) entity.HealthComponent().currentHealth -= 10f;
 }
Ejemplo n.º 32
0
 public override void PerformActionOnEntity(ImEntity entity)
 {
     entity.HealthComponent().currentHealth -= poisonPower_;
 }
Ejemplo n.º 33
0
 public void TestRaiseHealth(ImEntity entity)
 {
     if (entity.HealthComponent() != null) entity.HealthComponent().currentHealth += 10f;
 }