summaryrefslogtreecommitdiffstats
path: root/knights/match_param.h
diff options
context:
space:
mode:
Diffstat (limited to 'knights/match_param.h')
-rw-r--r--knights/match_param.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/knights/match_param.h b/knights/match_param.h
new file mode 100644
index 0000000..ff48227
--- /dev/null
+++ b/knights/match_param.h
@@ -0,0 +1,100 @@
+/***************************************************************************
+ match_param.h - description
+ -------------------
+ begin : Tue Jun 25 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef MATCH_PARAM_H
+#define MATCH_PARAM_H
+
+/**
+ *@author Troy Corbin Jr.
+ */
+
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qpixmap.h>
+#include <qvaluelist.h>
+#include <qtimer.h>
+#include "definitions.h"
+#include "resource.h"
+
+class match_param : public QObject
+{
+ Q_OBJECT
+
+ private:
+ resource *myResource;
+ QStringList PlayerNames;
+ QValueList<QPixmap> PlayerImages;
+
+ /*
+ This is used to keep the signal valuesChanged
+ from triggering multiple times in a row.
+ */
+ bool TimerFlag;
+
+ char Type[4];
+ TCPList Time_White;
+ TCPList Time_Black;
+ char Strength[4];
+ int Variation;
+
+ protected:
+ void initialize( void );
+ void lookupTCP( void );
+ void lookupNames( void );
+ void lookupImages( void );
+ void setTimer( void );
+
+ public:
+ match_param( resource *Rsrc=0 );
+ match_param( resource*, const int &whiteType, const int &blackType );
+ ~match_param();
+
+ char type( const int &player )
+ { return Type[player]; }
+
+ char strength( const int &player )
+ { return Strength[player]; }
+
+ QPixmap image( const char &player )
+ { return PlayerImages[player]; }
+
+ QString name( const char &player )
+ { return PlayerNames[player]; }
+
+ TCPList time( const char &player );
+
+ void setType( const int &player, const char &type );
+
+ void setStrength( const int &player, const char &str )
+ { setTimer(); myResource->Strength[player] = Strength[player] = str; }
+
+ void setTime( const char &player, const TCPList &tcp );
+
+ void setName( const int &player, const QString &name )
+ { PlayerNames[player] = name; }
+
+ void setVariation( const int variation );
+ int getVariation( void );
+
+ public slots:
+ void slot_Timer( void );
+
+ signals:
+ void valuesChanged( void );
+};
+
+#endif