-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
132 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keywords | ||
|
||
import ( | ||
"github.com/DecentralCardGame/cardobject/cardobject" | ||
"github.com/DecentralCardGame/cardobject/jsonschema" | ||
) | ||
|
||
type beast struct{} | ||
|
||
func (b beast) ValidateType(r jsonschema.RootElement) error { | ||
return jsonschema.ValidateStruct(b, r) | ||
} | ||
|
||
func (b beast) InteractionText() string { | ||
return "3/3 beast" | ||
} | ||
|
||
func (b beast) Description() string { | ||
return "A 3/3 entity token." | ||
} | ||
|
||
func (b beast) Classes() []jsonschema.Class { | ||
return []jsonschema.Class{cardobject.NATURE} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keywords | ||
|
||
import ( | ||
"github.com/DecentralCardGame/cardobject/cardobject" | ||
"github.com/DecentralCardGame/cardobject/jsonschema" | ||
) | ||
|
||
type bot struct{} | ||
|
||
func (b bot) ValidateType(r jsonschema.RootElement) error { | ||
return jsonschema.ValidateStruct(b, r) | ||
} | ||
|
||
func (b bot) InteractionText() string { | ||
return "2/2 Bot" | ||
} | ||
|
||
func (b bot) Description() string { | ||
return "A 2/2 entity token." | ||
} | ||
|
||
func (b bot) Classes() []jsonschema.Class { | ||
return []jsonschema.Class{cardobject.TECHNOLOGY} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keywords | ||
|
||
import ( | ||
"github.com/DecentralCardGame/cardobject/cardobject" | ||
"github.com/DecentralCardGame/cardobject/jsonschema" | ||
) | ||
|
||
type recruit struct{} | ||
|
||
func (re recruit) ValidateType(r jsonschema.RootElement) error { | ||
return jsonschema.ValidateStruct(re, r) | ||
} | ||
|
||
func (re recruit) InteractionText() string { | ||
return "1/1 recruit" | ||
} | ||
|
||
func (re recruit) Description() string { | ||
return "A 1/1 entity token." | ||
} | ||
|
||
func (re recruit) Classes() []jsonschema.Class { | ||
return []jsonschema.Class{cardobject.CULTURE} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keywords | ||
|
||
import ( | ||
"github.com/DecentralCardGame/cardobject/cardobject" | ||
"github.com/DecentralCardGame/cardobject/jsonschema" | ||
) | ||
|
||
type spirit struct{} | ||
|
||
func (s spirit) ValidateType(r jsonschema.RootElement) error { | ||
return jsonschema.ValidateStruct(s, r) | ||
} | ||
|
||
func (s spirit) InteractionText() string { | ||
return "1/1 spirit" | ||
} | ||
|
||
func (s spirit) Description() string { | ||
return "A 1/1 entity token with OnDeath: Insight 1." | ||
} | ||
|
||
func (s spirit) Classes() []jsonschema.Class { | ||
return []jsonschema.Class{cardobject.MYSTICISM} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"Entity":{"CardName":"Name","CastingCost":13,"Class":{"Nature":false,"Mysticism":false,"Technology":true,"Culture":true},"Abilities":[{"Pay":{"ManaAmount":2,"Effects":[{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}}]}}],"Attack":10,"Health":10,"FlavourText":"-.-","Tags":["SPIRIT"],"Keywords":["ARM","PAY"],"RulesTexts":["This could be your RulesText",""]}} | ||
{"Entity":{"CardName":"Name","CastingCost":13,"Class":{"Nature":false,"Mysticism":false,"Technology":true,"Culture":true},"Abilities":[{"Pay":{"ManaAmount":2,"Effects":[{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Spawn":{"Token":{"Recruit":{}},"Amount":{"SimpleIntValue":2}}}]}}],"Attack":10,"Health":10,"FlavourText":"-.-","Tags":["SPIRIT"],"Keywords":["ARM","PAY"],"RulesTexts":["This could be your RulesText",""]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keywords | ||
|
||
import ( | ||
"github.com/DecentralCardGame/cardobject/jsonschema" | ||
) | ||
|
||
type token struct { | ||
Beast *beast `json:",omitempty"` | ||
Bot *bot `json:",omitempty"` | ||
Recruit *recruit `json:",omitempty"` | ||
Spirit *spirit `json:",omitempty"` | ||
} | ||
|
||
func (t token) ValidateType(r jsonschema.RootElement) error { | ||
implementer, err := t.FindImplementer() | ||
if err != nil { | ||
return err | ||
} | ||
return implementer.ValidateType(r) | ||
} | ||
|
||
func (t token) FindImplementer() (jsonschema.Validateable, error) { | ||
return jsonschema.FindImplementer(t) | ||
} |