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!"); } VobDict.Add(vob.ID, vob); if (!(vob is NPCProto) && !(vob is Item)) { VobList.Add(vob); } if (vob is NPCProto) { addPlayer((NPCProto)vob); } else if (vob is Item) { addItem((Item)vob); } }
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; }