func (l *entityList) Add(e entity.Entity) {
	l.Lock()
	defer l.Unlock()
	l.set = append(l.set, e)
}
Add puts e entity into the collection set.
package world
import (
	"sync"
	"github.com/spkaeros/rscgo/pkg/game/entity"
)
type Entity struct {
	entity.Location
	Index int
}
func (e *Entity) Point() entity.Location {
	return entity.Location(e)
}
func (e *Entity) ServerIndex() int {
	return e.Index
}
func (e *Entity) AtLocation(location Location) bool {
	return e.Near(location, 0)
}
type entityList struct {
	set  []entity.Entity
	sync.RWMutex
}
func (l *entityList) NearbyPlayers(e entity.MobileEntity) []entity.MobileEntity {
	l.RLock()
	defer l.RUnlock()
	var players []entity.MobileEntity
	for _, v := range l.set {
		if p, ok := v.(*Player); ok && p.ServerIndex() != e.ServerIndex() && p.Near(e, e.SessionCache().VarInt("viewRadius", 16)) {
			players = append(players, p)
		}
	}
	return players
}
func (l *entityList) NearbyNpcs(e entity.MobileEntity) []entity.MobileEntity {
	l.RLock()
	defer l.RUnlock()
	var npcs []entity.MobileEntity
	for _,  v := range l.set {
		if n, ok := v.(*NPC); ok && n.Near(e, e.SessionCache().VarInt("viewRadius", 16)) {
			npcs = append(npcs, n)
		}
	}
	return npcs
}
func (l *entityList) NearbyObjects(e entity.MobileEntity) []entity.Entity {
	l.RLock()
	defer l.RUnlock()
	var objects []entity.Entity
	for _, o1 := range l.set {
		if o, ok := o1.(*Object); ok && e.Near(o, e.SessionCache().VarInt("viewRadius", 16) * 2) {
			objects = append(objects, o)
		}
	}
	return objects
}
func (l *entityList) Range(fn func(entity.Entity)) {
	l.RLock()
	defer l.RUnlock()
	for _, o1 := range l.set {
		fn(o1)
	}
}
func (l *entityList) NearbyItems(e entity.MobileEntity) []entity.Entity {
	l.RLock()
	defer l.RUnlock()
	var items []entity.Entity
	for _, i := range l.set {
		if i, ok := i.(*GroundItem); ok && i.Near(e, e.SessionCache().VarInt("viewRadius", 16)>>1) {
			if p := AsPlayer(e); p != nil && !i.VisibleTo(p) {
				continue
			}
			items = append(items, i)
		}
	}
	return items
}