delaunay/mst working
This commit is contained in:
@ -3,7 +3,7 @@ package gamemap
|
||||
import (
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/types"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
|
||||
)
|
||||
|
||||
//fixme move to config
|
||||
@ -13,12 +13,12 @@ var mapHeight = 90
|
||||
|
||||
type Level struct {
|
||||
types.Rect
|
||||
ctx util.ClientCtx
|
||||
Name string
|
||||
Branch string
|
||||
Depth int
|
||||
Objects *[]ecs.Entity
|
||||
Tiles []*Tile
|
||||
ctx appctx.ClientCtx
|
||||
Name string
|
||||
Branch string
|
||||
Depth int
|
||||
Objects *[]ecs.Entity
|
||||
Tiles []*Tile
|
||||
}
|
||||
|
||||
func (l *Level) GetTile (coords types.Coords) *Tile {
|
||||
@ -63,7 +63,7 @@ func (l *Level) Put (x, y int, tileFunc interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
func NewLevel(ctx util.ClientCtx, branch string, depth int) *Level {
|
||||
func NewLevel(ctx appctx.ClientCtx, branch string, depth int) *Level {
|
||||
l := &Level{
|
||||
ctx: ctx,
|
||||
Name: branch + string(depth),
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
|
||||
//fixme move to config
|
||||
var minRoomSize = 3
|
||||
var maxRoomSize = 22
|
||||
var maxrooms = 20
|
||||
var maxRoomSize = 15
|
||||
var maxrooms = 50
|
||||
|
||||
var fges = map[int]types.RectFill{
|
||||
1: types.RectFill{
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/items"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/mob"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/types"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
|
||||
)
|
||||
|
||||
type PrefabFile struct {
|
||||
@ -42,10 +42,10 @@ func LoadPrefabFile(filename string) (*PrefabFile, error) {
|
||||
}
|
||||
|
||||
type PrefabLoader struct {
|
||||
ctx util.ClientCtx
|
||||
ctx appctx.ClientCtx
|
||||
}
|
||||
|
||||
func NewPrefabLoader(ctx util.ClientCtx) PrefabLoader {
|
||||
func NewPrefabLoader(ctx appctx.ClientCtx) PrefabLoader {
|
||||
return PrefabLoader{ctx: ctx}
|
||||
}
|
||||
|
||||
@ -103,9 +103,9 @@ func (pfbl PrefabLoader) PrefabRoomsList() []Room {
|
||||
room.Connectors = append(room.Connectors, types.Coords{i,j})
|
||||
} else {
|
||||
f, ok = TileTypeMap[shortName]
|
||||
}
|
||||
if (!ok) {
|
||||
pfbl.ctx.Logger().Warn().Msgf("Unknown tile: %s", shortName)
|
||||
if (!ok) {
|
||||
pfbl.ctx.Logger().Warn().Msgf("Unknown tile: %s", shortName)
|
||||
}
|
||||
}
|
||||
room.Geometry[i+ j*room.W] = f
|
||||
}
|
||||
|
Reference in New Issue
Block a user