bool IsValidMove( ChessBoardSquare srcSquare, ChessBoardSquare trgSquare, ChessMover.sMove userMove ) { foreach( ChessMover.sMove move in listCurrMovable ) { if( move.srcSquare == srcSquare && move.trgSquare == trgSquare ) { userMove.Set( move ); return true; } } userMove.Clear(); return false; }
bool IsValidAIMove( ChessBoardSquare srcSquare, ChessBoardSquare trgSquare, List<ChessMover.sMove> listMove, ChessMover.sMove aiMove ) { foreach( ChessMover.sMove move in listMove ) { if( move.srcSquare == srcSquare && move.trgSquare == trgSquare ) { aiMove.Set( move ); return true; } } aiMove.Clear(); return false; }