more refact

This commit is contained in:
2026-08-30 23:01:48 +02:00
parent 3890edc946
commit 28b1662195
38 changed files with 353 additions and 663 deletions
+32
View File
@@ -0,0 +1,32 @@
package inc
type Tape struct {
Name string
Item string
Dialogue string
}
func (t Tape) GetName() string { return t.Name }
func IsTape(name string) bool { return TapeManager.Has(name) }
func TapeOf(item string) (Tape, bool) {
for _, t := range TapeManager.All() {
if t.Item != "" && t.Item == item {
return t, true
}
}
return Tape{}, false
}
func IsTapeItem(item string) bool {
_, ok := TapeOf(item)
return ok
}
func TapeDialogue(item string) string {
if t, ok := TapeOf(item); ok && t.Dialogue != "" {
return t.Dialogue
}
return DlgDex
}