public Figure GetFigureOnLocation(FieldLocation fieldLocation) { return(Figures.FirstOrDefault(x => x.Location.Row == fieldLocation.Row && x.Location.Column == fieldLocation.Column)); }
public Move(int rowFrom, int colFrom, int rowTo, int colTo, GameSide gameSide) { Side = gameSide; From = new FieldLocation(rowFrom, colFrom); To = new FieldLocation(rowTo, colTo); }
public Move(FieldLocation from, FieldLocation to, GameSide gameSide) { From = new FieldLocation(from.Row, from.Column); To = new FieldLocation(to.Row, to.Column); Side = gameSide; }
private bool IsInBoard(FieldLocation location) { return(location.Column >= 1 && location.Row >= 1 && location.Column <= 8 && location.Row <= 8); }