init, basic structure, putting into a script for easy card builds

This commit is contained in:
🐙PiperYxzzy
2022-11-02 15:11:15 +02:00
parent 56f741380d
commit 05ef071a0e
7 changed files with 220 additions and 0 deletions

70
main.go Normal file
View File

@@ -0,0 +1,70 @@
package main
import (
"encoding/json"
"os"
)
type Card struct {
Name map[string]string
Description map[string]string
Copies int
}
type Action struct {
Card
Instant bool
Persistent bool
}
type Mission struct {
Card
}
type Stance struct {
Card
Type string
BetrayBetray int
BargainBargain int
BetrayBargain int
BargainBetray int
}
type Final struct {
Card
Priority int
}
func main() {
a, _ := os.Open("cards/actions.json")
defer a.Close()
dec := json.NewDecoder(a)
actions := []Action{}
if err := dec.Decode(&actions); err != nil {
panic(err)
}
s, _ := os.Open("cards/stances.json")
defer s.Close()
dec = json.NewDecoder(s)
stances := []Stance{}
if err := dec.Decode(&stances); err != nil {
panic(err)
}
f, _ := os.Open("cards/finals.json")
defer f.Close()
dec = json.NewDecoder(f)
finals := []Final{}
if err := dec.Decode(&finals); err != nil {
panic(err)
}
m, _ := os.Open("cards/missions.json")
defer f.Close()
dec = json.NewDecoder(m)
missions := []Mission{}
if err := dec.Decode(&missions); err != nil {
panic(err)
}
}