last_light/game/npc/npc.go

35 lines
556 B
Go
Raw Normal View History

2024-05-30 23:39:54 +03:00
package npc
2024-05-12 23:22:39 +03:00
import (
"mvvasilev/last_light/engine"
"github.com/gdamore/tcell/v2"
"github.com/google/uuid"
)
2024-05-21 23:08:51 +03:00
type BasicNPC struct {
2024-05-12 23:22:39 +03:00
id uuid.UUID
engine.Positioned
}
2024-05-21 23:08:51 +03:00
func CreateNPC(pos engine.Position) *BasicNPC {
return &BasicNPC{
2024-05-12 23:22:39 +03:00
id: uuid.New(),
Positioned: engine.WithPosition(pos),
}
}
2024-05-21 23:08:51 +03:00
func (c *BasicNPC) MoveTo(newPosition engine.Position) {
2024-05-12 23:22:39 +03:00
c.Positioned.SetPosition(newPosition)
}
2024-05-21 23:08:51 +03:00
func (c *BasicNPC) UniqueId() uuid.UUID {
2024-05-12 23:22:39 +03:00
return c.id
}
2024-05-21 23:08:51 +03:00
func (c *BasicNPC) Input(e *tcell.EventKey) {
2024-05-12 23:22:39 +03:00
}
2024-05-21 23:08:51 +03:00
func (c *BasicNPC) Tick(dt int64) {
2024-05-12 23:22:39 +03:00
}