summaryrefslogtreecommitdiff
path: root/crawler/kingdom.go
diff options
context:
space:
mode:
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
+}