mirror of
https://github.com/mvvasilev/last_light.git
synced 2025-04-19 12:49:52 +03:00
Add ui element interface
This commit is contained in:
parent
873ba7e3e0
commit
422840fc7b
4 changed files with 26 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
last_light
|
||||
last_light.exe
|
|
@ -18,6 +18,7 @@
|
|||
- Fire
|
||||
- Cold
|
||||
- Necrotic
|
||||
- Thunder
|
||||
- Acid
|
||||
- Poison
|
||||
- 9-level Dungeon
|
||||
|
|
|
@ -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 {
|
||||
id uuid.UUID
|
||||
layers []*layer
|
||||
|
|
12
ui/ui.go
Normal file
12
ui/ui.go
Normal 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
|
||||
}
|
Loading…
Add table
Reference in a new issue