2009-11-17 00:36:38 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2009-11-17 00:36:38 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2009-11-17 00:36:38 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_core_rebus
|
|
|
|
#define headerfile_winix_core_rebus
|
2009-11-17 00:36:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
struct Cur;
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
2009-11-17 00:36:38 +01:00
|
|
|
class Rebus
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct Item
|
|
|
|
{
|
|
|
|
int key;
|
2010-11-21 01:19:17 +01:00
|
|
|
std::wstring question;
|
2009-11-17 00:36:38 +01:00
|
|
|
int answer;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
void SetCur(Cur * pcur);
|
2009-11-17 00:36:38 +01:00
|
|
|
void Init();
|
|
|
|
Item * Rand();
|
2010-11-21 01:19:17 +01:00
|
|
|
bool IsAnswerOk(Item * item, const std::wstring & answer);
|
2010-08-10 18:12:50 +02:00
|
|
|
bool CheckRebus();
|
2009-11-17 00:36:38 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
Cur * cur;
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2009-11-17 00:36:38 +01:00
|
|
|
bool InitPair(int a, int b, Item & item);
|
|
|
|
|
|
|
|
std::vector<Item> table;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|