mirror of
https://github.com/mvvasilev/last_light.git
synced 2025-04-19 12:49:52 +03:00
30 lines
456 B
Go
30 lines
456 B
Go
package ui
|
|
|
|
import (
|
|
"mvvasilev/last_light/engine"
|
|
|
|
"github.com/gdamore/tcell/v2"
|
|
)
|
|
|
|
type UIElement interface {
|
|
MoveTo(x, y int)
|
|
Position() engine.Position
|
|
Size() engine.Size
|
|
Input(e *tcell.EventKey)
|
|
|
|
engine.Drawable
|
|
}
|
|
|
|
type UIHighlightableElement interface {
|
|
IsHighlighted() bool
|
|
Highlight()
|
|
Unhighlight()
|
|
SetHighlighted(highlighted bool)
|
|
UIElement
|
|
}
|
|
|
|
type UISelectableElement interface {
|
|
Select()
|
|
OnSelect(func())
|
|
UIHighlightableElement
|
|
}
|