Add ui element interface

This commit is contained in:
Miroslav Vasilev 2024-04-21 03:48:58 +03:00
parent 873ba7e3e0
commit 422840fc7b
4 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
last_light last_light
last_light.exe

View file

@ -18,6 +18,7 @@
- Fire - Fire
- Cold - Cold
- Necrotic - Necrotic
- Thunder
- Acid - Acid
- Poison - Poison
- 9-level Dungeon - 9-level Dungeon

View file

@ -37,6 +37,18 @@ func (l *layer) draw(s tcell.Screen) {
} }
} }
type unorderedDrawContainer struct {
id uuid.UUID
contents []Drawable
}
func CreateUnorderedDrawContainer(contents []Drawable) unorderedDrawContainer {
return unorderedDrawContainer{
id: uuid.New(),
contents: contents,
}
}
type layeredDrawContainer struct { type layeredDrawContainer struct {
id uuid.UUID id uuid.UUID
layers []*layer layers []*layer

12
ui/ui.go Normal file
View file

@ -0,0 +1,12 @@
package ui
import (
"mvvasilev/last_light/util"
"github.com/google/uuid"
)
type UIElement interface {
UniqueId() uuid.UUID
Position() util.Position
}