summaryrefslogtreecommitdiffstats
path: root/knights/command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knights/command.cpp')
-rw-r--r--knights/command.cpp98
1 files changed, 98 insertions, 0 deletions
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;
+}