Skip to content

Commit

Permalink
Merge pull request #21 from hborawski/villagers-setup
Browse files Browse the repository at this point in the history
fix: villagers should show in tokens for gameplay setup
  • Loading branch information
hborawski authored Mar 15, 2021
2 parents 8c72709 + be075e4 commit e691e3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions DominionCompanion/models/SetModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct SetModel {
var minusCostTokens: Bool { self.cards.filter({$0.tokens.minusCost}).count > 0 }
var trashingTokens: Bool { self.cards.filter({$0.tokens.trashing}).count > 0 }
var estateTokens: Bool { self.cards.filter({$0.tokens.estate}).count > 0 }
var villagers: Bool { self.cards.filter({$0.tokens.villagers}).count > 0}
var projectTokens: Bool { projects.count > 0 }


Expand All @@ -72,6 +73,7 @@ struct SetModel {
if debt { tokens.append("Debt Tokens") }
if victoryTokens { tokens.append("Victory Tokens") }
if coinTokens { tokens.append("Coin Tokens") }
if villagers { tokens.append("Coin Tokens (Villagers)") }
if embargoTokens { tokens.append("Embargo Tokens") }
if journeyToken { tokens.append("Journey Token") }
if minusCardTokens { tokens.append("-Card Token") }
Expand Down
3 changes: 2 additions & 1 deletion UnitTests/models/SetModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class SetModelTests: XCTestCase {
TestData.getCard("Alchemist"),
TestData.getCard("Forge"),
TestData.getCard("City Quarter"),
TestData.getCard("Village"),
TestData.getCard("Recruiter"),
TestData.getCard("Bishop"),
TestData.getCard("Cobbler"),
TestData.getCard("Butcher")
Expand All @@ -131,6 +131,7 @@ class SetModelTests: XCTestCase {

XCTAssertTrue(tokens.contains("Debt Tokens"))
XCTAssertTrue(tokens.contains("Coin Tokens"))
XCTAssertTrue(tokens.contains("Coin Tokens (Villagers)"))
}

func testShareableSet() {
Expand Down

0 comments on commit e691e3d

Please sign in to comment.