freg  0.3
Free-Roaming Elementary Game
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Slots | Private Member Functions | List of all members
VirtScreen Class Referenceabstract

This class provides base for all screens for freg. More...

#include <VirtScreen.h>

Inheritance diagram for VirtScreen:
Inheritance graph
[legend]
Collaboration diagram for VirtScreen:
Collaboration graph
[legend]

Public Slots

virtual void Notify (QString) const =0
 This is called for a notification to be displayed. More...
 
virtual void PassString (QString &) const =0
 This is called when string is needed to be received from input. More...
 
virtual void Update (int x, int y, int z)=0
 This is called when block at (x, y, z) should be updated in screen. More...
 
virtual void UpdateAll ()=0
 This is called when all world should be updated in sceen. More...
 
virtual void Move (int)=0
 Called when world loaded zone is moved to update world in screen. More...
 
virtual void UpdatePlayer ()=0
 Called when some player property needs to be updated in screen. More...
 
virtual void UpdateAround (int x, int y, int z, int rng)=0
 Called when area around xyz with range needs to be updated. More...
 
virtual void UpdatesEnd ()
 This is called when current group of updates is ended. More...
 
void DeathScreen ()
 This is called when player is dead, and displayed until respawn. More...
 
virtual void ActionXyz (int *x, int *y, int *z) const
 Used to get player focus coordinates from screen. More...
 
virtual void DisplayFile (QString path)
 This shows a file by path. More...
 

Signals

void ExitReceived ()
 This is emitted when input receives exit key. More...
 

Public Member Functions

 VirtScreen (World *, Player *)
 Constructor makes player and world connections. More...
 
 VirtScreen (VirtScreen &)=delete
 
virtual ~VirtScreen ()
 

Static Public Member Functions

static char CharName (int kind, int sub)
 
static int Color (int kind, int sub)
 

Protected Member Functions

WorldGetWorld () const
 

Protected Attributes

World *const w
 
Player *const player
 
QSettings settings
 
QString previousCommand
 

Private Slots

virtual void Print ()=0
 Prints world. Should not be called not within screen. More...
 

Private Member Functions

 VirtScreen (const VirtScreen &)=delete
 
VirtScreenoperator= (const VirtScreen &)=delete
 

Detailed Description

This class provides base for all screens for freg.

It provides interface for world-screen and player-screen communications by its slots and signals.

Definition at line 104 of file VirtScreen.h.

Constructor & Destructor Documentation

VirtScreen::VirtScreen ( World world_,
Player player_ 
)

Constructor makes player and world connections.

Constructor of non-virtual screen should contain this code to connect to player for sending input: connect(this, SIGNAL(InputReceived(int, int)), player, SLOT(Act(int, int)), Qt::DirectConnection);

Definition at line 29 of file VirtScreen.cpp.

VirtScreen::VirtScreen ( VirtScreen )
delete
VirtScreen::~VirtScreen ( )
virtual

Definition at line 66 of file VirtScreen.cpp.

VirtScreen::VirtScreen ( const VirtScreen )
privatedelete

Member Function Documentation

void VirtScreen::ActionXyz ( int *  x,
int *  y,
int *  z 
) const
virtualslot

Used to get player focus coordinates from screen.

x, y, z are coordinates where player will make action. May be reimplemented in derivative class to get xyz other than world direction-based focus.

Definition at line 70 of file VirtScreen.cpp.

char VirtScreen::CharName ( int  kind,
int  sub 
)
static

Definition at line 131 of file VirtScreen.cpp.

int VirtScreen::Color ( int  kind,
int  sub 
)
static

Definition at line 76 of file VirtScreen.cpp.

void VirtScreen::DeathScreen ( )
slot

This is called when player is dead, and displayed until respawn.

Definition at line 27 of file VirtScreen.cpp.

void VirtScreen::DisplayFile ( QString  path)
virtualslot

This shows a file by path.

Standard (non-reimpemented) version does nothing.

Definition at line 68 of file VirtScreen.cpp.

void VirtScreen::ExitReceived ( )
signal

This is emitted when input receives exit key.

This is connected to application exit.

World * VirtScreen::GetWorld ( ) const
protected

Definition at line 74 of file VirtScreen.cpp.

void VirtScreen::Move ( int  )
pure virtualslot

Called when world loaded zone is moved to update world in screen.

When implemented, this should work fast. It is connected to world in constructor.

Definition at line 197 of file VirtScreen.cpp.

void VirtScreen::Notify ( QString  ) const
pure virtualslot

This is called for a notification to be displayed.

Definition at line 201 of file VirtScreen.cpp.

VirtScreen& VirtScreen::operator= ( const VirtScreen )
privatedelete
void VirtScreen::PassString ( QString &  ) const
pure virtualslot

This is called when string is needed to be received from input.

It is connected to world in constructor.

Definition at line 202 of file VirtScreen.cpp.

void VirtScreen::Print ( )
privatepure virtualslot

Prints world. Should not be called not within screen.

Definition at line 200 of file VirtScreen.cpp.

void VirtScreen::Update ( int  x,
int  y,
int  z 
)
pure virtualslot

This is called when block at (x, y, z) should be updated in screen.

When implemented, this should work fast. It is connected to world in constructor.

Definition at line 195 of file VirtScreen.cpp.

void VirtScreen::UpdateAll ( )
pure virtualslot

This is called when all world should be updated in sceen.

When implemented, this should work fast. It is connected to world in constructor.

Definition at line 196 of file VirtScreen.cpp.

void VirtScreen::UpdateAround ( int  x,
int  y,
int  z,
int  rng 
)
pure virtualslot

Called when area around xyz with range needs to be updated.

When implemented, this should work fast. It is connected to world in constructor.

Definition at line 199 of file VirtScreen.cpp.

void VirtScreen::UpdatePlayer ( )
pure virtualslot

Called when some player property needs to be updated in screen.

When implemented, this should work fast. It is connected to world in constructor.

Definition at line 198 of file VirtScreen.cpp.

void VirtScreen::UpdatesEnd ( )
virtualslot

This is called when current group of updates is ended.

This is called from world when pack of world changing is ended. ( Can be used in screen optimization. )

Definition at line 26 of file VirtScreen.cpp.

Member Data Documentation

Player* const VirtScreen::player
protected

Definition at line 190 of file VirtScreen.h.

QString VirtScreen::previousCommand
protected

Definition at line 192 of file VirtScreen.h.

QSettings VirtScreen::settings
protected

Definition at line 191 of file VirtScreen.h.

World* const VirtScreen::w
protected

Definition at line 189 of file VirtScreen.h.


The documentation for this class was generated from the following files: