summaryrefslogtreecommitdiff
path: root/crawler/kingdom.go
diff options
context:
space:
mode:
authorMax2018-03-07 23:35:48 +0100
committerMax2018-03-07 23:35:48 +0100
commit543f556fc2ae52f4f47f6241fa4fab33bec8d9fc (patch)
tree380a0ff8e6006ff2d28a77796cdc071d21a940e9 /crawler/kingdom.go
downloaddominion_cards-543f556fc2ae52f4f47f6241fa4fab33bec8d9fc.tar.gz
Initial commit.
Diffstat (limited to 'crawler/kingdom.go')
-rw-r--r--crawler/kingdom.go78
1 files changed, 78 insertions, 0 deletions
diff --git a/crawler/kingdom.go b/crawler/kingdom.go
new file mode 100644
index 0000000..fb62cfb
--- /dev/null
+++ b/crawler/kingdom.go
@@ -0,0 +1,78 @@
+package main
+
+import (
+ "strings"
+)
+
+func IsKingdom(Card Card, SplitPile []Card) bool {
+
+ switch Card.Name {
+ case "Platinum":
+ return false
+ case "Gold":
+ return false
+ case "Silver":
+ return false
+ case "Copper":
+ return false
+ case "Province":
+ return false
+ case "Duchy":
+ return false
+ case "Estate":
+ return false
+ case "Curse":
+ return false
+ }
+
+ switch Card.Type {
+ case "State":
+ return false
+ case "Hex":
+ return false
+ case "Boon":
+ return false
+ case "Landmark":
+ return false
+ case "Event":
+ return false
+ }
+
+ if strings.Contains(Card.Type, "Prize") {
+ return false
+ }
+ if strings.Contains(Card.Type, "Ruins") {
+ return false
+ }
+ if strings.Contains(Card.Type, "Shelter") {
+ return false
+ }
+ if strings.Contains(Card.Type, "Heirloom") {
+ return false
+ }
+
+ if strings.Contains(Card.text, "(This is not in the Supply.)") {
+ return false
+ }
+
+ if strings.Contains(Card.Type, "Castle") && Card.Name != "Humble Castle" {
+ return false
+ }
+
+ if IsSplitCardOnBottom(Card, SplitPile) {
+ return false
+ }
+
+ return true
+}
+
+func IsSplitCardOnBottom(Card Card, SplitPile []Card) bool {
+ for _, v := range SplitPile {
+ names := strings.Split(v.Name, "/")
+ if Card.Name == names[1] {
+ return true
+ }
+ }
+
+ return false
+}