mirror of
https://github.com/mvvasilev/last_light.git
synced 2025-04-19 12:49:52 +03:00
30 lines
413 B
Go
30 lines
413 B
Go
package model
|
|
|
|
import (
|
|
"mvvasilev/last_light/util"
|
|
|
|
"github.com/gdamore/tcell/v2"
|
|
"github.com/gdamore/tcell/v2/views"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Direction int
|
|
|
|
const (
|
|
Up Direction = iota
|
|
Down
|
|
Left
|
|
Right
|
|
)
|
|
|
|
type Entity interface {
|
|
UniqueId() uuid.UUID
|
|
Draw(v views.View)
|
|
Input(e *tcell.EventKey)
|
|
Tick(dt int64)
|
|
}
|
|
|
|
type MovableEntity interface {
|
|
Position() util.Position
|
|
Move(dir Direction)
|
|
}
|