package client import ( "io/fs" "path/filepath" "github.com/chompy/roguelike_rpg/internal/util" ) type ActionType string const ( PhysicalActionType ActionType = "physical" SupportActionType ActionType = "support" ArtifactActionType ActionType = "artifact" ConsumableActionType ActionType = "consumable" ) type Action struct { Name string `yaml:"name"` Type ActionType `yaml:"type"` Target Target `yaml:"target"` Effects map[string]int `yaml:"effects"` } type ActionList []*Action func (l ActionList) Get(name string) *Action { for _, item := range l { if item.Name == name { return item } } return nil } func LoadActions(assetFS fs.FS) (ActionList, error) { actions := make(ActionList, 0) if err := util.ReadYAML(assetFS, filepath.Join("combat", "actions.yaml"), &actions); err != nil { return nil, err } return actions, nil }