new square constructors
This commit is contained in:
parent
de321719f4
commit
ad1c4c57ad
7 changed files with 59 additions and 44 deletions
|
|
@ -81,8 +81,8 @@ impl UciMove {
|
|||
pub fn from_ascii(s: &[u8]) -> Option<Self> {
|
||||
match s {
|
||||
[a, b, c, d, s @ ..] => Some(Self {
|
||||
from: Square::new(File::from_ascii(*a)?, Rank::from_ascii(*b)?),
|
||||
to: Square::new(File::from_ascii(*c)?, Rank::from_ascii(*d)?),
|
||||
from: Square::from_coords(File::from_ascii(*a)?, Rank::from_ascii(*b)?),
|
||||
to: Square::from_coords(File::from_ascii(*c)?, Rank::from_ascii(*d)?),
|
||||
promotion: match s {
|
||||
[] => None,
|
||||
[c] => Some(Role::from_ascii(*c)?),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue