示例#1
0
 /// <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);
     }
 }
示例#2
0
        /// <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);
        }
示例#3
0
        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);
        }