MOve glyph code into client
This commit is contained in:
parent
4a89cb9d6e
commit
da91d31649
3 changed files with 4 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
||||||
package atlas
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mdiluz/rove/pkg/atlas"
|
|
||||||
"github.com/mdiluz/rove/pkg/maths"
|
"github.com/mdiluz/rove/pkg/maths"
|
||||||
"github.com/mdiluz/rove/pkg/version"
|
"github.com/mdiluz/rove/pkg/version"
|
||||||
"github.com/mdiluz/rove/proto/roveapi"
|
"github.com/mdiluz/rove/proto/roveapi"
|
||||||
|
@ -288,9 +287,9 @@ func InnerMain(command string, args ...string) error {
|
||||||
t := response.Tiles[i+num*j]
|
t := response.Tiles[i+num*j]
|
||||||
o := response.Objects[i+num*j]
|
o := response.Objects[i+num*j]
|
||||||
if o != roveapi.Object_ObjectUnknown {
|
if o != roveapi.Object_ObjectUnknown {
|
||||||
fmt.Printf("%c", atlas.ObjectGlyph(o))
|
fmt.Printf("%c", ObjectGlyph(o))
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%c", atlas.TileGlyph(t))
|
fmt.Printf("%c", TileGlyph(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package atlas
|
package atlas
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mdiluz/rove/pkg/maths"
|
"github.com/mdiluz/rove/pkg/maths"
|
||||||
|
@ -252,21 +251,7 @@ func TestAtlas_GetSetCorrect(t *testing.T) {
|
||||||
|
|
||||||
func TestAtlas_WorldGen(t *testing.T) {
|
func TestAtlas_WorldGen(t *testing.T) {
|
||||||
a := NewChunkAtlas(8)
|
a := NewChunkAtlas(8)
|
||||||
|
|
||||||
// Spawn a large world
|
// Spawn a large world
|
||||||
_, _ = a.QueryPosition(maths.Vector{X: 20, Y: 20})
|
_, _ = a.QueryPosition(maths.Vector{X: 20, Y: 20})
|
||||||
|
|
||||||
// Print out the world for manual evaluation
|
|
||||||
num := 20
|
|
||||||
for j := num - 1; j >= 0; j-- {
|
|
||||||
for i := 0; i < num; i++ {
|
|
||||||
t, o := a.QueryPosition(maths.Vector{X: i, Y: j})
|
|
||||||
if o.Type != roveapi.Object_ObjectUnknown {
|
|
||||||
fmt.Printf("%c", ObjectGlyph(o.Type))
|
|
||||||
} else {
|
|
||||||
fmt.Printf("%c", TileGlyph(t))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
fmt.Print("\n")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue