diff options
Diffstat (limited to 'src/main/game/pile.cpp')
| -rw-r--r-- | src/main/game/pile.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/game/pile.cpp b/src/main/game/pile.cpp index 28eb0a8..641174e 100644 --- a/src/main/game/pile.cpp +++ b/src/main/game/pile.cpp @@ -73,14 +73,19 @@ bool pile::can_place(const card c) const { card top_c = top_card(); - // Check suit + // Checks violation of same suit policy if (build_policy == pol::SAME_SUIT && c.get_suit() != top_c.get_suit()) { return false; } + // Checks violation of specific suit policy if (sol_rules::is_suit(build_policy) && c.get_suit() != sol_rules::suit_val(build_policy)) { return false; } + // Checks violation of red-black suit policy + if (build_policy == pol::RED_BLACK && c.get_colour() == top_c.get_colour()) { + return false; + } int tc_r = top_c.get_rank(); int comp_r = c.get_rank(); |
