fixed problem
This commit is contained in:
parent
733ffe3380
commit
3dcf69715a
|
@ -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,
|
||||
|
|
|
@ -14,4 +14,8 @@ type Entity interface {
|
|||
Style() goro.Style
|
||||
SetStyle(goro.Style)
|
||||
Move(int, int)
|
||||
Name() string
|
||||
SetName(string)
|
||||
Flags() uint
|
||||
SetFlags(uint)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
5
main.go
5
main.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user