bool IsOccupied(Move move) { Position startPos = move.NewStartPos(); Vehicle v = this.board[startPos.X, startPos.Y]; if (v != null && v != move.movingVehicle) return true; Position endPos = move.NewEndPos(); v = this.board[endPos.X, endPos.Y]; if (v != null && v != move.movingVehicle) return true; return false; }
bool IsInBounds(Move move) { Position startPos = move.NewStartPos(); if (startPos.X < 0 || startPos.Y < 0) return false; Position endPos = move.NewEndPos(); if (endPos.X >= this.board.GetLength(0) || endPos.Y >= this.board.GetLength(1)) return false; return true; }