More refactoring. The code is ALMOST able to compile now – all three programs together give a mere 25 errors.
git-svn-id: http://openexile.googlecode.com/svn/trunk@31 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
94
osx/town.h
94
osx/town.h
@@ -6,13 +6,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "talking.h"
|
||||
|
||||
namespace legacy {
|
||||
struct town_record_type;
|
||||
struct big_tr_type;
|
||||
struct ave_tr_type;
|
||||
struct tiny_tr_type;
|
||||
struct creature_start_type;
|
||||
struct wandering_type;
|
||||
struct preset_item_type;
|
||||
struct preset_field_type;
|
||||
};
|
||||
|
||||
class cTown { // formerly town_record_type
|
||||
@@ -29,21 +31,29 @@ public:
|
||||
char spec_enc_code,time_code;
|
||||
short monster_time,personality;
|
||||
short special_on_kill,facial_pic;
|
||||
|
||||
cCreature& operator = (legacy::creature_start_type old);
|
||||
};
|
||||
class cWandering { // formerly wnadering_type
|
||||
class cWandering { // formerly wandering_type
|
||||
public:
|
||||
unsigned char monst[4];
|
||||
|
||||
cWandering& operator = (legacy::wandering_type old);
|
||||
};
|
||||
class cItem { // formerly preset_item_type
|
||||
public:
|
||||
location loc;
|
||||
short code,ability;
|
||||
unsigned char charges,always_there,property,contained;
|
||||
|
||||
cItem& operator = (legacy::preset_item_type old);
|
||||
};
|
||||
class cField { // formerly preset_field_type
|
||||
public:
|
||||
location loc;
|
||||
short type;
|
||||
|
||||
cField& operator = (legacy::preset_field_type old);
|
||||
};
|
||||
short town_chop_time,town_chop_key;
|
||||
cWandering wandering[4];
|
||||
@@ -55,7 +65,7 @@ public:
|
||||
location start_locs[4];
|
||||
location exit_locs[4];
|
||||
short exit_specs[4];
|
||||
Rect in_town_rect;
|
||||
rectangle in_town_rect;
|
||||
cItem preset_items[64];
|
||||
short max_num_monst;
|
||||
cField preset_fields[50];
|
||||
@@ -73,7 +83,6 @@ public:
|
||||
char spec_strs[100][256];
|
||||
char sign_strs[20][256];
|
||||
char(& town_strs(short i))[256];
|
||||
char talk_strs[170][256];
|
||||
cSpeech talking;
|
||||
|
||||
virtual ~cTown(){}
|
||||
@@ -81,82 +90,13 @@ public:
|
||||
virtual void append(legacy::ave_tr_type& old);
|
||||
virtual void append(legacy::tiny_tr_type& old);
|
||||
virtual unsigned char& terrain(size_t x, size_t y) = 0;
|
||||
virtual Rect& room_rect(size_t i) = 0;
|
||||
virtual rectangle& room_rect(size_t i) = 0;
|
||||
virtual cCreature& creatures(size_t i) = 0;
|
||||
virtual unsigned char& lighting(size_t i, size_t r) = 0;
|
||||
virtual short max_dim() = 0;
|
||||
virtual short max_monst() = 0;
|
||||
|
||||
cTown();
|
||||
cTown(short size);
|
||||
cTown& operator = (legacy::town_record_type& old);
|
||||
};
|
||||
|
||||
class cBigTown : public cTown { // formerly big_tr_type
|
||||
unsigned char _terrain[64][64];
|
||||
Rect _room_rect[16];
|
||||
cCreature _creatures[60];
|
||||
unsigned char _lighting[8][64];
|
||||
public:
|
||||
void append(legacy::big_tr_type& old);
|
||||
unsigned char& terrain(size_t x, size_t y);
|
||||
Rect& room_rect(size_t i);
|
||||
cCreature& creatures(size_t i);
|
||||
unsigned char& lighting(size_t i, size_t r);
|
||||
short max_dim();
|
||||
|
||||
cBigTown();
|
||||
};
|
||||
|
||||
class cMedTown : public cTown { // formerly ave_tr_type
|
||||
unsigned char _terrain[48][48];
|
||||
Rect _room_rect[16];
|
||||
cCreature _creatures[40];
|
||||
unsigned char _lighting[6][48];
|
||||
public:
|
||||
void append(legacy::ave_tr_type& old);
|
||||
unsigned char& terrain(size_t x, size_t y);
|
||||
Rect& room_rect(size_t i);
|
||||
cCreature& creatures(size_t i);
|
||||
unsigned char& lighting(size_t i, size_t r);
|
||||
short max_dim();
|
||||
|
||||
cMedTown();
|
||||
};
|
||||
|
||||
class cTinyTown : public cTown { // formerly tiny_tr_type
|
||||
unsigned char _terrain[32][32];
|
||||
Rect _room_rect[16];
|
||||
cCreature _creatures[30];
|
||||
unsigned char _lighting[4][32];
|
||||
public:
|
||||
void append(legacy::tiny_tr_type& old);
|
||||
unsigned char& terrain(size_t x, size_t y);
|
||||
Rect& room_rect(size_t i);
|
||||
cCreature& creatures(size_t i);
|
||||
unsigned char& lighting(size_t i, size_t r);
|
||||
short max_dim();
|
||||
|
||||
cTinyTown();
|
||||
};
|
||||
|
||||
// City blocks - I want to figure out how to use these sometime.
|
||||
|
||||
//struct city_block_type {
|
||||
// short block_type;
|
||||
// short block_destroy_time;
|
||||
// char block_alignment;
|
||||
// char block_key_time;
|
||||
// location block_loc;
|
||||
//};
|
||||
//
|
||||
//struct city_ter_rect_type {
|
||||
// Rect what_rect;
|
||||
// unsigned char ter_type;
|
||||
// unsigned char hollow;
|
||||
//};
|
||||
//
|
||||
//struct template_town_type {
|
||||
// creature_start_type creatures[30];
|
||||
// city_block_type city_block[15];
|
||||
// city_ter_rect_type city_ter_rect[10];
|
||||
//};
|
||||
};
|
||||
Reference in New Issue
Block a user