Example #1
0
        public List <Character> GetCharactersInRange(Position pos, int distance)
        {
            List <Character> nearbyChars = ActiveClientEntities.Where(entity => entity is Character && MapEngine.GetDistance(pos.X, pos.Y, entity.Position.X, entity.Position.Y) <= distance).Cast <Character>().ToList();

            return(nearbyChars);
        }
Example #2
0
        private Client[] GetNearByClients(Client c)
        {
            var nearbyClients = clients.Where(x => (mapEngine.GetDistance(x.MyCharacter.X, x.MyCharacter.Y, c.MyCharacter.X, c.MyCharacter.Y) < 150));

            return(nearbyClients.ToArray());
        }