Exemple #1
0
        public void RemoveGameObject(NetGameObject inGameObject)
        {
            int index = inGameObject.GetIndexInWorld();

            int lastIndex = mGameObjects.Count - 1;

            if (index != lastIndex)
            {
                mGameObjects[index] = mGameObjects[lastIndex];
                mGameObjects[index].SetIndexInWorld(index);
            }

            inGameObject.SetIndexInWorld(-1);

            mGameObjects.RemoveAt(lastIndex);

            inGameObject.CompleteRemove();

            //mWorldMap.RemoveObject(inGameObject);

            if (inGameObject.GetMapId() != 0)
            {
                RemoveNetGameObject((GameObjectClassId)inGameObject.GetClassId(), inGameObject.GetMapId());
            }
        }
Exemple #2
0
        public void AddGameObject(NetGameObject inGameObject)
        {
            mGameObjects.Add(inGameObject);
            inGameObject.SetIndexInWorld(mGameObjects.Count - 1);

            //mWorldMap.InsertObject(inGameObject);
        }