From a8c9924456e5335c964e4e55b2dde1963c88726f Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 17 Feb 2010 01:24:36 +0000 Subject: Added KDE3 version of Knights git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knights@1091568 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- knights/command.cpp | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 knights/command.cpp (limited to 'knights/command.cpp') diff --git a/knights/command.cpp b/knights/command.cpp new file mode 100644 index 0000000..a67088a --- /dev/null +++ b/knights/command.cpp @@ -0,0 +1,98 @@ +/*************************************************************************** + command.cpp - description + ------------------- + begin : Sun Jun 30 2002 + copyright : (C) 2003 by Troy Corbin Jr. + email : tcorbin@users.sf.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "command.h" + +Command::Command( int ID, int Command, int WhiteTime, int BlackTime, struct ChessMove Move ) +{ + white_time = WhiteTime; + black_time = BlackTime; + move = Move; + id = ID; + command = Command; +} + +Command::Command( int ID, int Command, int WhiteTime, int BlackTime, struct ChessMove Move, QString Data ) +{ + white_time = WhiteTime; + black_time = BlackTime; + data = Data; + move = Move; + id = ID; + command = Command; +} + +Command::Command( int ID, int Command, int WhiteTime, int BlackTime, QString Data ) +{ + white_time = WhiteTime; + black_time = BlackTime; + data = Data; + id = ID; + command = Command; +} + +Command::Command( int ID, int Command ) +{ + clear(); + id = ID; + command = Command; +} + +Command::Command( int ID, int Command, QString Data ) +{ + clear(); + id = ID; + command = Command; + data = Data; +} + +Command::Command() +{ + clear(); +} + +Command::~Command() +{ +} + +void Command::clear(void) +{ + white_time = 0; + black_time = 0; + command = CMD_None; + clearMove( &move ); +} +/////////////////////////////////////// +// +// Command::clearMove +// +/////////////////////////////////////// +void Command::clearMove( ChessMove *Move ) +{ + Move->fromFile = Null; + Move->fromRank = Null; + Move->toFile = Null; + Move->toRank = Null; + Move->Promote = Null; + Move->ManTaken = Null; + Move->NAG = 0; + Move->ICS_MoveCounter = 0; + Move->ICS_PawnPushFile = Null; + Move->ICS_Mode = Null; + Move->ICS_OnMove = 0; + Move->ICS_ClockTicking = TRUE; +} -- cgit v1.2.3