func (l Location) Masks(x, y int) (masks [2]byte) {
	if y > l.Y() {
		if x > l.X() {
			masks[1] |= ClipWest
		} else if x < l.X() {
			masks[1] |= ClipEast
		}
		masks[0] |= ClipNorth
	} else if y < l.Y() {
		if x > l.X() {
			masks[1] |= ClipWest
		} else if x < l.X() {
			masks[1] |= ClipEast
		}
		masks[0] |= ClipSouth
	} else {
		if x > l.X() {
			masks[1] |= ClipEast
		} else if x < l.X() {
			masks[1] |= ClipWest
		}
	}
	return masks
}
Masks returns appropriate collision bitmasks to check for obstacles on when traversing from this location
toward the given x,y coordinates.
Returns: [2]byte {verticalMasks, horizontalMasks}
package world
import (
	"encoding/binary"
	"fmt"
	"os"
	"sync"
	"github.com/spkaeros/rscgo/pkg/config"
	"github.com/spkaeros/rscgo/pkg/definitions"
	"github.com/spkaeros/rscgo/pkg/game/entity"
	"github.com/spkaeros/rscgo/pkg/jag"
	"github.com/spkaeros/rscgo/pkg/log"
	"github.com/spkaeros/rscgo/pkg/strutil"
)
type CollisionMask int16
type Sector struct {
	Tiles [2304]CollisionMask
}
var Sectors = make(map[int]*Sector)
var SectorsLock sync.RWMutex
func LoadCollisionData() {
	archive := jag.New(config.DataDir() + string(os.PathSeparator) + "landscape.jag")
	for _, f := range archive.Files {
		Sectors[f.Hash] = loadSector(f.Data)
	}
}
const (
	ClipNorth = 1 << iota
	ClipEast
	ClipSouth
	ClipWest
	ClipCanProjectile
	ClipSwNe
	ClipSeNw
	ClipFullBlock
)
func ClipBit(direction int) int {
	var mask int
	if direction == North || direction == NorthEast || direction == NorthWest {
		mask |= ClipNorth
	}
	if direction == South || direction == SouthEast || direction == SouthWest {
		mask |= ClipSouth
	}
	if direction == East || direction == SouthEast || direction == NorthEast {
		mask |= ClipEast
	}
	if direction == West || direction == SouthWest || direction == NorthWest {
		mask |= ClipWest
	}
	return mask
}