We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a46c1b4 commit 09348dbCopy full SHA for 09348db
gomori/src/board/compact_field.rs
@@ -85,6 +85,17 @@ impl CompactField {
85
}
86
87
88
+ /// All cards on the field.
89
+ ///
90
+ /// Equal to [`hidden_cards()`] + [`top_card()`], if any.
91
+ pub fn all_cards(self) -> CardsSet {
92
+ if let Some(c) = self.top_card() {
93
+ self.hidden_cards().insert(c)
94
+ } else {
95
+ self.hidden_cards()
96
+ }
97
98
+
99
pub fn into_field(self, i: i8, j: i8) -> Field {
100
Field {
101
i,
@@ -164,6 +175,11 @@ mod python {
164
175
self.hidden_cards()
165
176
166
177
178
+ #[pyo3(name = "all_cards")]
179
+ fn py_all_cards(&self) -> CardsSet {
180
+ self.all_cards()
181
182
167
183
#[pyo3(name = "into_field")]
168
184
fn py_into_field(&self, i: i8, j: i8) -> Field {
169
185
self.into_field(i, j)
0 commit comments