| 1e01a22 by Enrico Ros at 2009-02-21 |
1 |
/*************************************************************************** |
| 0e5745d by Enrico Ros at 2009-05-31 |
2 |
* Copyright (c) 2009 Enrico Ros * |
|
3 |
* 2009 Enrico Ros <enrico.ros@email.it> * |
|
4 |
* 2009 Alberto Scarpa <skaal.sl@gmail.com> * |
| 1e01a22 by Enrico Ros at 2009-02-21 |
5 |
* * |
|
6 |
* Permission is hereby granted, free of charge, to any person * |
|
7 |
* obtaining a copy of this software and associated documentation * |
|
8 |
* files (the "Software"), to deal in the Software without * |
|
9 |
* restriction, including without limitation the rights to use, * |
|
10 |
* copy, modify, merge, publish, distribute, sublicense, and/or sell * |
|
11 |
* copies of the Software, and to permit persons to whom the * |
|
12 |
* Software is furnished to do so, subject to the following * |
|
13 |
* conditions: * |
|
14 |
* * |
|
15 |
* The above copyright notice and this permission notice shall be * |
|
16 |
* included in all copies or substantial portions of the Software. * |
|
17 |
* * |
|
18 |
***************************************************************************/ |
|
19 |
|
| e45848b by Enrico Ros at 2009-05-31 |
20 |
#ifndef __AbstractGame_h__ |
|
21 |
#define __AbstractGame_h__ |
| 1e01a22 by Enrico Ros at 2009-02-21 |
22 |
|
|
23 |
#include <QObject> |
| e45848b by Enrico Ros at 2009-05-31 |
24 |
#include <QPixmap> |
| 9d1b99e by Enrico Ros at 2009-02-25 |
25 |
class Ocr; |
| e45848b by Enrico Ros at 2009-05-31 |
26 |
class ScreenCapture; |
| 6336a38 by Enrico Ros at 2009-02-25 |
27 |
namespace Ui { class AppWidgetClass; } |
| 1e01a22 by Enrico Ros at 2009-02-21 |
28 |
|
| e45848b by Enrico Ros at 2009-05-31 |
29 |
class AbstractGame : public QObject |
| 1e01a22 by Enrico Ros at 2009-02-21 |
30 |
{ |
|
31 |
Q_OBJECT |
|
32 |
public: |
| e45848b by Enrico Ros at 2009-05-31 |
33 |
AbstractGame( QObject * parent = 0 ); |
|
34 |
virtual ~AbstractGame(); |
| 1e01a22 by Enrico Ros at 2009-02-21 |
35 |
|
| e45848b by Enrico Ros at 2009-05-31 |
36 |
// utility functions |
|
37 |
virtual QPixmap highlightPixmap( const QPixmap & pixmap ) const = 0; |
|
38 |
virtual void train( Ocr * ocr, QString lettersText, const QImage & gamePixmap ) const = 0; |
| 7ee4d03 by Enrico Ros at 2009-02-25 |
39 |
|
| e45848b by Enrico Ros at 2009-05-31 |
40 |
// game logic |
|
41 |
// ... |
|
42 |
virtual void run( Ui::AppWidgetClass * ui, const ScreenCapture * capture, const Ocr * ocr ) = 0; |
| 1e01a22 by Enrico Ros at 2009-02-21 |
43 |
|
| e45848b by Enrico Ros at 2009-05-31 |
44 |
Q_SIGNALS: |
|
45 |
void gameEnded(); |
| 1e01a22 by Enrico Ros at 2009-02-21 |
46 |
}; |
|
47 |
|
| e45848b by Enrico Ros at 2009-05-31 |
48 |
#endif // __AbstractGame_h__ |