Skip to content

Commit

Permalink
deps up
Browse files Browse the repository at this point in the history
  • Loading branch information
s0rg committed Dec 28, 2023
1 parent d978ff6 commit 52858c7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/s0rg/grid

go 1.21
go 1.21.5

require (
github.com/s0rg/array2d v1.1.1
github.com/s0rg/set v1.0.1
github.com/s0rg/vec2d v1.1.1
github.com/s0rg/set v1.2.0
github.com/s0rg/vec2d v1.2.0
github.com/zyedidia/generic v1.2.1
)

require (
github.com/segmentio/fasthash v1.0.3 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
github.com/s0rg/array2d v1.1.1 h1:fPZDbolqx9P0gCaD9yFTZT0TcWa6o/gK4t0YnGRpp/0=
github.com/s0rg/array2d v1.1.1/go.mod h1:XUVXpxRB1bSnngbrTAyfEcLl6GP+8OpyFLEkwvQOukI=
github.com/s0rg/set v1.0.1 h1:eJ2KSRUwnIZOBtlQScgET80+jkm/ro01pn6YeZzgWp4=
github.com/s0rg/set v1.0.1/go.mod h1:aBGSm+F2mCTDjNIRR4GMB04NMqZBhtSh0tOBe/u5z5k=
github.com/s0rg/vec2d v1.1.1 h1:asdV+Iev4M5lcFwB46883k8oLku4JgNQHyI/4SHAtMo=
github.com/s0rg/vec2d v1.1.1/go.mod h1:/0pgb+2ax3mWfBZ1gb9LMMFawvmGyWpgCjk8a/ImCgg=
github.com/s0rg/set v1.2.0 h1:53b207YMktNQJXYei/oHuTR5oOO2e9+eieZOncYsh9g=
github.com/s0rg/set v1.2.0/go.mod h1:xz3nDbjF4nyMLvAHvmE7rigXpNrKKTsi6iANznIB1/4=
github.com/s0rg/vec2d v1.2.0 h1:ilCq4dWAZtPy+VFmyc4mUIxonXCeXxFDwE0o5Y48V5U=
github.com/s0rg/vec2d v1.2.0/go.mod h1:+V8qlJQahzxDQ2gRs6b6JWBePp3z48CHYc5qO6Ciik8=
github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/zyedidia/generic v1.2.1 h1:Zv5KS/N2m0XZZiuLS82qheRG4X1o5gsWreGb0hR7XDc=
github.com/zyedidia/generic v1.2.1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
4 changes: 2 additions & 2 deletions grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (m *Map[T]) Path(
var (
road *path
last image.Point
closed = make(set.Set[image.Point])
closed = make(set.Unordered[image.Point])
)

queue := heap.New[*path](func(a, b *path) bool {
Expand All @@ -145,7 +145,7 @@ func (m *Map[T]) Path(
road, _ = queue.Pop()
last = road.Last()

if !closed.TryAdd(last) {
if !closed.Add(last) {
continue
}

Expand Down
18 changes: 9 additions & 9 deletions grid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func TestMapPath(t *testing.T) {
src = image.Pt(1, 1)
dst = image.Pt(3, 2)
dirs = Points(DirectionsCardinal...)
walls = make(set.Set[image.Point])
walls = make(set.Unordered[image.Point])
coster = func(p image.Point, d float64, _ struct{}) (cost float64, walkable bool) {
return d, !walls.Has(p)
}
Expand Down Expand Up @@ -357,8 +357,8 @@ func TestMapLOS(t *testing.T) {

var (
src = image.Pt(1, 1)
walls = make(set.Set[image.Point])
seen = make(set.Set[image.Point])
walls = make(set.Unordered[image.Point])
seen = make(set.Unordered[image.Point])
caster = func(p image.Point, _ float64, _ struct{}) (walkable bool) {
if walls.Has(p) {
return false
Expand Down Expand Up @@ -386,7 +386,7 @@ func TestMapLOS(t *testing.T) {
t.Fail()
}

seen = make(set.Set[image.Point])
seen = make(set.Unordered[image.Point])

m.LineOfSight(image.Pt(10, 10), 6.0, caster)

Expand All @@ -405,7 +405,7 @@ func TestMapRayOOB(t *testing.T) {
)

var (
seen = make(set.Set[image.Point])
seen = make(set.Unordered[image.Point])
caster = func(p image.Point, _ float64, _ struct{}) (walkable bool) {
seen.Add(p)

Expand Down Expand Up @@ -439,8 +439,8 @@ func TestMapShadow(t *testing.T) {

var (
src = image.Pt(1, 1)
walls = make(set.Set[image.Point])
seen = make(set.Set[image.Point])
walls = make(set.Unordered[image.Point])
seen = make(set.Unordered[image.Point])
caster = func(p image.Point, _ float64, _ struct{}) (walkable bool) {
if walls.Has(p) {
return false
Expand Down Expand Up @@ -486,7 +486,7 @@ func TestMapDijkstra(t *testing.T) {

var (
src = image.Pt(2, 1)
walls = make(set.Set[image.Point])
walls = make(set.Unordered[image.Point])
targets = []image.Point{image.Pt(2, 4)}
dirs = Points(DirectionsCardinal...)
)
Expand Down Expand Up @@ -593,7 +593,7 @@ func TestLineBresenham(t *testing.T) {
m := New[struct{}](image.Rect(0, 0, W, H))

for i, c := range cases {
seen := make(set.Set[image.Point])
seen := make(set.Unordered[image.Point])

m.LineBresenham(c.Src, c.Dst, func(p image.Point, _ struct{}) (ok bool) {
seen.Add(p)
Expand Down

0 comments on commit 52858c7

Please sign in to comment.