public virtual void RefreshVisibleObject()
{
//在地图被销毁的怪物啊-- 掉落物品啊..刷新的时候找不到了就删除掉!
uint id = 0;
List<uint> templist = null;
foreach (RefreshObject refobj in mVisibleList.Values)
{
BaseObject obj = refobj.obj;
if(obj.type == OBJECTTYPE.MONSTER ||
obj.type == OBJECTTYPE.GUARDKNIGHT) id =obj.GetTypeId();
else id = obj.GetGameID();
if(GetGameMap().GetObject(id) == null)
{
if (templist == null) templist = new List<uint>();
templist.Add(id);
}
}
if (templist != null)
{
for (int i = 0; i < templist.Count; i++)
{
mVisibleList.Remove(templist[i]);
}
}
}
//取该坐标点是否有对象[优先判断是否有阻挡] public bool GetPointOfObj(BaseObject obj, short x, short y) { if (!CanMove(x, y)) { return(true); } obj.RefreshVisibleObject(); foreach (RefreshObject baseobj in obj.GetVisibleList().Values) { BaseObject _obj = baseobj.obj; if (_obj.GetCurrentX() == x && _obj.GetCurrentY() == y) { return(true); } } if (mListAddObj.Count > 0) { for (int i = 0; i < mListAddObj.Count; i++) { BaseObject _obj = mListAddObj[i]; if (_obj.GetCurrentX() == x && _obj.GetCurrentY() == y) { return(true); } } } return(false); }