Exemplo n.º 1
0
        public static void removeVob(Vob vob)
        {
            if (vob == null)
            {
                throw new ArgumentNullException("AddVob: Vob can't be null!");
            }
            if (vob.ID == 0)
            {
                throw new ArgumentException("AddVob: Vob.ID can't be null!");
            }
            if (!VobDict.ContainsKey(vob.ID))
            {
                throw new ArgumentException("AddVob: Vob.ID is not in the list: " + vob.ID + " " + vob.VobType + " " + vob);
            }

#if D_CLIENT
            if (vob.Address != 0)
            {
                sWorld.SpawnedVobDict.Remove(vob.Address);
                vob.Address = 0;
            }
#endif
            vob.IsSpawned = false;
            vob.Created   = false;
            if (vob.Map != null && vob.Map.Length != 0)
            {
                sWorld.getWorld(vob.Map).removeVob(vob);
            }

            VobDict.Remove(vob.ID);
            vob.Created = false;
        }
Exemplo n.º 2
0
 public static void addVob(Vob vob)
 {
     if (vob == null)
     {
         throw new ArgumentNullException("AddVob: Vob can't be null!");
     }
     if (vob.ID == 0)
     {
         throw new ArgumentException("AddVob: Vob.ID can't be null!");
     }
     if (VobDict.ContainsKey(vob.ID))
     {
         throw new ArgumentException("AddVob: Vob.ID is already in the list: " + vob.ID + " " + vob.VobType + " " + vob);
     }
     VobDict.Add(vob.ID, vob);
     vob.Created = true;
 }