Exemple #1
0
 public void SendByDist(WorldObject obj, PacketWriter packet, float dist)
 {
     foreach (var s in Sessions)
     {
         if (obj.CheckDistance(s.Value.Character, dist))
         {
             s.Value.Send(ref packet);
         }
     }
 }
Exemple #2
0
 public IEnumerable <GameObjectSpawn> GetInRangeGameObjects(WorldObject obj)
 {
     foreach (var g in GameObjectSpawns)
     {
         if (!obj.ToCharacter().InRangeObjects.ContainsKey(g.Key))
         {
             if (obj.CheckDistance(g.Value))
             {
                 yield return(g.Value);
             }
         }
     }
 }
Exemple #3
0
 public IEnumerable <CreatureSpawn> GetInRangeCreatures(WorldObject obj)
 {
     foreach (var c in CreatureSpawns)
     {
         if (!obj.ToCharacter().InRangeObjects.ContainsKey(c.Key))
         {
             if (obj.CheckDistance(c.Value))
             {
                 yield return(c.Value);
             }
         }
     }
 }
Exemple #4
0
        public IEnumerable <Character> GetOutOfRangeCharacter(WorldObject obj)
        {
            var tempSessions = new Dictionary <ulong, WorldClass>(Sessions);

            tempSessions.Remove(obj.Guid);

            foreach (var c in tempSessions.ToList())
            {
                if (obj.ToCharacter().InRangeObjects.ContainsKey(c.Key))
                {
                    if (!obj.CheckDistance(c.Value.Character))
                    {
                        yield return(c.Value.Character);
                    }
                }
            }
        }