32 settings(
home_path +
"freg.ini", QSettings::IniFormat),
33 previousCommand(settings.value(
"last_command",
"moo").toString())
36 Qt::DirectConnection);
38 Qt::DirectConnection);
40 connect(
player, SIGNAL(GetFocus(
int *,
int *,
int *)),
41 SLOT(
ActionXyz(
int *,
int *,
int *)), Qt::DirectConnection);
43 connect(
w, SIGNAL(GetString(QString &)),
44 SLOT(
PassString(QString &)), Qt::DirectConnection);
45 connect(
player, SIGNAL(GetString(QString &)),
46 SLOT(
PassString(QString &)), Qt::DirectConnection);
49 Qt::DirectConnection);
50 connect(
w, SIGNAL(UpdatedAll()), SLOT(
UpdateAll()),
51 Qt::DirectConnection);
52 connect(
w, SIGNAL(Moved(
int)), SLOT(
Move(
int)),
53 Qt::DirectConnection);
54 connect(
w, SIGNAL(Updated(
int,
int,
int)), SLOT(
Update(
int,
int,
int)),
55 Qt::DirectConnection);
56 connect(
w, SIGNAL(UpdatedAround(
int,
int,
int,
int)),
58 Qt::DirectConnection);
59 connect(
w, SIGNAL(UpdatesEnded()), SLOT(
UpdatesEnd()),
60 Qt::DirectConnection);
63 Qt::DirectConnection );
78 case LIQUID:
switch ( sub ) {
90 default:
switch ( sub ) {
120 case DWARF:
switch ( sub ) {
132 switch ( static_cast<kinds>(kind) ) {
133 case BUSH:
return ';';
134 case DWARF:
return '@';
136 case GRASS:
return (
FIRE == sub ) ?
'f' :
'.';
138 case CLOCK:
return 'c';
139 case PLATE:
return '_';
141 case PICK:
return '\\';
144 case AXE:
return '/';
145 case BELL:
return 'b';
154 case DOOR:
return (
STONE == sub ) ?
'#' :
'\'';
156 case WEAPON:
switch ( sub ) {
158 case STONE:
return '.';
159 case SKY:
return ' ';
164 case BOOTS:
return 'B';
171 case SAND:
return '.';
172 case WATER:
return '*';
173 case STONE:
return ':';
175 case BLOCK:
switch ( sub ) {
177 case SOIL:
return '.';
178 case WATER:
return '~';
182 case GLASS:
return 'g';
183 case ROSE:
return ';';
184 case COAL:
return '*';
185 case STAR:
return '.';
187 case AIR:
return ' ';
virtual void Update(int x, int y, int z)=0
This is called when block at (x, y, z) should be updated in screen.
static char CharName(int kind, int sub)
virtual void ActionXyz(int *x, int *y, int *z) const
Used to get player focus coordinates from screen.
World provides global physics and shred connection.
static int Color(int kind, int sub)
dirs GetDir() const
This returns current player direction (see enum dirs in header.h)
virtual void UpdateAll()=0
This is called when all world should be updated in sceen.
virtual void UpdateAround(int x, int y, int z, int rng)=0
Called when area around xyz with range needs to be updated.
virtual void Notify(QString) const =0
This is called for a notification to be displayed.
virtual void UpdatePlayer()=0
Called when some player property needs to be updated in screen.
virtual void UpdatesEnd()
This is called when current group of updates is ended.
virtual void PassString(QString &) const =0
This is called when string is needed to be received from input.
VirtScreen(World *, Player *)
Constructor makes player and world connections.
virtual void DisplayFile(QString path)
This shows a file by path.
void DeathScreen()
This is called when player is dead, and displayed until respawn.
bool Focus(int x, int y, int z, int *x_targ, int *y_targ, int *z_targ, dirs dir) const
False on error, true if focus is received to _targ successfully.
virtual void Print()=0
Prints world. Should not be called not within screen.
This class contains information specific to player and interface for manipulating him...
virtual void Move(int)=0
Called when world loaded zone is moved to update world in screen.