aboutsummaryrefslogtreecommitdiff
path: root/internal/cardart/store.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-08-03 14:08:09 -0400
committerhistoria <[not public]>2026-08-03 14:08:09 -0400
commit612e429de438821ae8e099d6b54f87c11ff6c1b5 (patch)
treead6f9edf74339b9b50f9c7c2cd314ee7b6e04b2c /internal/cardart/store.go
parentf51424c90dbce7191a31b6e675818c985f0f4539 (diff)
downloadthehouseoficarus-612e429de438821ae8e099d6b54f87c11ff6c1b5.tar.gz
refactor: casino game slop refactor
Diffstat (limited to 'internal/cardart/store.go')
-rw-r--r--internal/cardart/store.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/cardart/store.go b/internal/cardart/store.go
new file mode 100644
index 0000000..0763e46
--- /dev/null
+++ b/internal/cardart/store.go
@@ -0,0 +1,27 @@
+package cardart
+
+import (
+ "os"
+
+ "gopkg.in/yaml.v3"
+)
+
+type Store struct {
+ Cards map[string]map[int][]string `yaml:"cards"`
+}
+
+func Load(path string) *Store {
+ store := &Store{Cards: make(map[string]map[int][]string)}
+ data, err := os.ReadFile(path)
+ if err != nil || yaml.Unmarshal(data, store) != nil {
+ return store
+ }
+ return store
+}
+
+func (s *Store) Art(key string, size int) []string {
+ if s == nil || s.Cards == nil {
+ return nil
+ }
+ return s.Cards[key][size]
+}