コード例 #1
0
ファイル: move.c プロジェクト: guy-rosenmann/Chess-Program
/* Creates a move when playing in console mode. Also determines it's legality. */
Move createMove(Board *brd, int from, int to, int cap, int prom, char castling) {

    Move move;

    move.from = from;
    move.to = to;
    move.capture = cap;
    move.promotion = prom;
    move.castling = castling;

    if(!makeMove(brd,move)) move.from = 0;
    cancelMove(brd);

    return move;

}
コード例 #2
0
// private
QVariant kpAbstractSelectionTool::operationMove (Operation op,
        const QVariant &data1, const QVariant &data2)
{
    (void) data1;
    (void) data2;


    switch (op)
    {
    case HaventBegunDrawUserMessage:
        return /*virtual*/haventBegunDrawUserMessageMove ();

    case SetCursor:
        setCursorMove ();
        break;

    case BeginDraw:
        beginDrawMove ();
        break;

    case Draw:
        drawMove (currentPoint (), normalizedRect ());
        break;

    case Cancel:
        cancelMove ();
        break;

    case EndDraw:
        endDrawMove ();
        break;

    default:
        Q_ASSERT (!"Unhandled operation");
        break;
    }

    return QVariant ();
}