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); } } }
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); } } } }
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); } } } }
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); } } } }