more checking rooms

This commit is contained in:
anton.gurov
2019-11-12 14:52:17 +03:00
parent 4bdb51d9e3
commit 7837051e80
13 changed files with 82 additions and 37 deletions

View File

@ -12,7 +12,7 @@ import (
var invalidBlit = errors.New("trying to blit on existing good tile")
type Room struct {
*types.Rect
types.Rect
Center types.Coords
Geometry []func() *Tile
Mobs []mob.Mob
@ -73,8 +73,8 @@ func (room *Room) MoveToCoords(where types.Coords) *Room {
return room
}
func NewRandomRectRoom(rng *util.RNG, w, h int, fillage types.RectFill) *Room {
newRoom := &Room{
func NewRandomRectRoom(rng *util.RNG, w, h int, fillage types.RectFill) Room {
newRoom := Room{
Rect: types.NewRect(
0,
0,
@ -84,7 +84,7 @@ func NewRandomRectRoom(rng *util.RNG, w, h int, fillage types.RectFill) *Room {
Center: types.Coords{w / 2, h /2 },
Geometry: make([]func()*Tile, w*h),
}
newRoom.Blit(fillage, newRoom)
newRoom.Blit(fillage, &newRoom)
//add connectors
newRoom.Connectors = append(
newRoom.Connectors,