/// <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); } }
/// <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); } } }
//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); }
public virtual void UseSkill(int skillid, BaseGameEntity target) { //skill.SetOwner(this); SKillMananger.Instance.TryUseSkill(skillid, target, this); }