fixed problem

This commit is contained in:
Joel M. Southall 2019-07-24 21:04:21 -07:00
parent 733ffe3380
commit 3dcf69715a
4 changed files with 17 additions and 12 deletions

View File

@ -15,7 +15,7 @@ type Entity struct {
}
// NewEntity returns an interface to a new populated Entity.
func NewEntity(x int, y int, r rune, style goro.Style, name string, flags Flags) interfaces.Entity {
func NewEntity(x int, y int, r rune, style goro.Style, name string, flags uint) interfaces.Entity {
return &Entity{
x: x,
y: y,

View File

@ -14,4 +14,8 @@ type Entity interface {
Style() goro.Style
SetStyle(goro.Style)
Move(int, int)
Name() string
SetName(string)
Flags() uint
SetFlags(uint)
}

View File

@ -8,5 +8,5 @@ type GameMap interface {
IsOpaque(x, y int) bool
Explored(x, y int) bool
SetExplored(x, y int, explored bool)
MakeMap(maxRooms, roomMinSize, roomMaxSize int, player Entity)
MakeMap(maxRooms, roomMinSize, roomMaxSize int, entities *[]Entity, maxMonsters int)
}

View File

@ -1,6 +1,7 @@
package main
import (
"fmt"
"log"
"steel/entity"
"steel/interfaces"
@ -79,7 +80,7 @@ func main() {
fmt.Printf("You lick the %s in the shins, much to its enjoyment!\n", otherEntity.Name())
} else {
player.Move(action.X, action.Y)
forRecompute = true
fovRecompute = true
}
}
gameState = NPCTurnState
@ -95,7 +96,7 @@ func main() {
if gameState == NPCTurnState {
for i, e := range entities {
if i > 0 {
fmt.Printf("The &s punders.\n", e.Name())
fmt.Printf("The %s punders.\n", e.Name())
}
}
gameState = PlayerTurnState