1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
/*
* Seven Kingdoms: Ancient Adversaries
*
* Copyright 1997,1998 Enlight Software Ltd.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
//Filename : OGAMESET.H
//Description : Header file of Object GameSet
#ifndef __OGAMESET_H
#define __OGAMESET_H
#ifndef __ORESX_H
#include <ORESX.h>
#endif
#ifndef __ODB_H
#include <ODB.h>
#endif
//-------- Define struct SetRec ---------//
struct SetRec
{
enum { CODE_LEN=8, DES_LEN=60 };
char code[CODE_LEN];
char des[DES_LEN];
};
//-------- Define struct SetInfo ---------//
struct SetInfo
{
enum { CODE_LEN=8, DES_LEN=60 };
char code[CODE_LEN+1];
char des[DES_LEN+1];
};
//-------- Define class GameSet ---------//
class GameSet
{
public:
char init_flag;
short cur_set_id;
short set_count;
SetInfo* set_info_array;
ResourceIdx set_res;
Database set_db;
char set_opened_flag;
public:
GameSet() { init_flag=0; }
~GameSet() { deinit(); }
void init();
void deinit();
char* cur_set_code() { return set_info_array[cur_set_id-1].code; }
void open_set(int);
void close_set();
Database* open_db(const char*);
Database* get_db();
int find_set(char*);
SetInfo* operator()() { return set_info_array+cur_set_id-1; }
SetInfo* operator[](int recNo) { return set_info_array+recNo-1; }
private:
void load_set_header();
};
//---------------------------------------//
extern GameSet game_set;
#endif
|