Run D&D spell lanes through typed artifacts
This commit is contained in:
@@ -40,6 +40,10 @@ func (c *Codec) Schema() contracts.ArtifactSchema {
|
||||
|
||||
func (c *Codec) MediaType() string { return MediaType }
|
||||
|
||||
func (c *Codec) Metadata(value dnd.SpellList) map[string]any {
|
||||
return map[string]any{"spell_cast_count": len(value.SpellCasts)}
|
||||
}
|
||||
|
||||
func (c *Codec) Encode(value dnd.SpellList) ([]byte, error) {
|
||||
if err := validate(value); err != nil {
|
||||
return nil, fmt.Errorf("encode dnd spell list: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user