/// <summary> /// With this function you can iterate trough a specified amount of vobs. /// Example: /// foreach(Vob vob in world.VobIterator(0, 125)){} /// </summary> /// <param name="start">The start index for iteration</param> /// <param name="end">The end index for iteration.</param> /// <returns></returns> public System.Collections.IEnumerable VobIterator(int start, int end) { for (int i = start; i < end; i++) { WorldObjects.Vob vob = world.VobList[i]; yield return(vob.ScriptingVob); } }
/// <summary> /// Returns the Vob with the specified ID. /// You can get the id of all vobs (Players, NPCs, mobinters and items) with vob.ID /// </summary> /// <param name="id">The specified vobid</param> /// <returns>returns the vob with the specfied vob-id or null</returns> public static Vob getVob(int id) { WorldObjects.Vob v = null; sWorld.VobDict.TryGetValue(id, out v); if (v == null) { return(null); } return(v.ScriptingVob); }
public bool HasAIClient(WorldObjects.Vob baseVob) { bool hasAIClient = false; for (int i = 0; i < aiClients.Count; i++) { if (aiClients[i].BaseInst == baseVob) { hasAIClient = true; break; } } return(hasAIClient); }