예제 #1
0
 /// <summary>
 /// Add a entity into the entities container by reference.
 /// </summary>
 /// <param name="newEntity"></param>
 public void RegisterEntity(BaseGameEntity newEntity)
 {
     if (!EntityDic.ContainsKey(newEntity.ID))
     {
         EntityDic.Add(newEntity.ID, newEntity);
     }
 }
예제 #2
0
 /// <summary>
 /// Remove the entity from entities container by it's reference.
 /// </summary>
 /// <param name="entity"></param>
 public void RemoveEntity(BaseGameEntity entity)
 {
     if (!System.Object.ReferenceEquals(entity, null))
     {
         if (EntityDic.ContainsKey(entity.ID))
         {
             EntityDic.Remove(entity.ID);
         }
     }
 }
예제 #3
0
        //public virtual void UseItem(BaseItem item, BaseGameEntity target)
        //{
        //    if (!System.Object.ReferenceEquals(null, item) &&
        //        !System.Object.ReferenceEquals(null, target))
        //    {
        //        //item.Use(target);
        //        //ItemManager.Instance.TryUseItem()
        //    }
        //}

        public virtual void UseItem(int itemid, BaseGameEntity target)
        {
            ItemManager.Instance.TryUseItem(itemid, target);
        }
예제 #4
0
 public virtual void UseSkill(int skillid, BaseGameEntity target)
 {
     //skill.SetOwner(this);
     SKillMananger.Instance.TryUseSkill(skillid, target, this);
 }