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

#include <CursedScreen.h>

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

Public Slots

void Notify (QString) const override
 
void PassString (QString &) const override
 
void Update (int, int, int) override
 
void UpdateAll () override
 
void UpdatePlayer () override
 
void UpdateAround (int, int, int, int) override
 
void Move (int) override
 
void DeathScreen ()
 
void DisplayFile (QString path) override
 
void ActionXyz (int *x, int *y, int *z) const override
 
- Public Slots inherited from VirtScreen
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...
 

Public Member Functions

 Screen (World *, Player *, int &error, bool ascii)
 
 ~Screen () override
 
void ControlPlayer ()
 
void ControlPlayer (int ch)
 
- Public Member Functions inherited from VirtScreen
 VirtScreen (World *, Player *)
 Constructor makes player and world connections. More...
 
 VirtScreen (VirtScreen &)=delete
 
virtual ~VirtScreen ()
 

Private Slots

void Print () override
 

Private Member Functions

 Screen (const Screen &)=delete
 
Screenoperator= (const Screen &)=delete
 
char CharNumber (int z) const
 
char CharNumberFront (int x, int y) const
 
void Arrows (WINDOW *, int x, int y, dirs) const
 
void HorizontalArrows (WINDOW *, int y, dirs) const
 
void PrintNormal (WINDOW *, dirs) const
 
void PrintFront (dirs direction, int x=-1, int y=0) const
 
void PrintInv (WINDOW *, const Block *, const Inventory *) const
 
void PrintBar (int x, int color, int ch, int percent, bool value_position_right=true)
 Can print health, breath and other bars on hudWin. More...
 
bool PrintFile (WINDOW *, QString const &file_name)
 Returns false when file does not exist, otherwise true. More...
 
void PrintHUD ()
 
void PrintMiniMap ()
 
void PrintQuickInventory ()
 
void CleanFileToShow ()
 
void RePrint ()
 
void InventoryAction (int num) const
 
int Color (int kind, int sub) const
 
int ColorShred (shred_type) const
 
char PrintBlock (const Block &, WINDOW *) const
 
void SetActionMode (actions mode)
 
void ProcessCommand (QString command)
 
void ProcessMouse ()
 
void MovePlayer (dirs dir)
 
void MovePlayerDiag (dirs dir1, dirs dir2) const
 
int RandomBlink () const
 
bool RandomBit () const
 
BlockGetFocusedBlock () const
 Returns nullptr if block is not player->Visible(). More...
 
int GetNormalStartX () const
 
int GetNormalStartY () const
 
int GetMinimapStartX () const
 
int GetMinimapStartY () const
 
void ExamineOnNormalScreen (int x, int y, int z, int step) const
 

Static Private Member Functions

static bool IsScreenWide ()
 
static void PrintVerticalDirection (WINDOW *, int y, int x, dirs)
 

Private Attributes

WINDOW * windows [6]
 
WINDOW *& leftWin = windows[0]
 
WINDOW *& rightWin = windows[1]
 
WINDOW *& notifyWin = windows[2]
 
WINDOW *& hudWin = windows[3]
 
WINDOW *& minimapWin = windows[4]
 
WINDOW *& actionWin = windows[5]
 
QString lastNotification
 
IThread *const input
 
volatile bool updated
 
FILE *const notifyLog
 
actions actionMode
 
int shiftFocus
 Can be -1, 0, 1 for low, normal, and high focus. More...
 
QFile * fileToShow
 
const bool beepOn
 
const bool flashOn
 
const bool ascii
 
bool blinkOn
 
const QChar arrows [WEST+1]
 
SCREEN *const screen
 
bool inputActive = false
 
int randomBlink
 

Additional Inherited Members

- Signals inherited from VirtScreen
void ExitReceived ()
 This is emitted when input receives exit key. More...
 
- Static Public Member Functions inherited from VirtScreen
static char CharName (int kind, int sub)
 
static int Color (int kind, int sub)
 
- Protected Member Functions inherited from VirtScreen
WorldGetWorld () const
 
- Protected Attributes inherited from VirtScreen
World *const w
 
Player *const player
 
QSettings settings
 
QString previousCommand
 

Detailed Description

Definition at line 62 of file CursedScreen.h.

Constructor & Destructor Documentation

Screen::Screen ( World wor,
Player pl,
int &  error,
bool  ascii 
)

Definition at line 989 of file CursedScreen.cpp.

Screen::~Screen ( )
override

Definition at line 1092 of file CursedScreen.cpp.

Screen::Screen ( const Screen )
privatedelete

Member Function Documentation

void Screen::ActionXyz ( int *  x,
int *  y,
int *  z 
) const
overrideslot

Definition at line 512 of file CursedScreen.cpp.

void Screen::Arrows ( WINDOW *  window,
int  x,
int  y,
dirs  direction 
) const
private

Definition at line 46 of file CursedScreen.cpp.

char Screen::CharNumber ( int  z) const
private

Definition at line 142 of file CursedScreen.cpp.

char Screen::CharNumberFront ( int  x,
int  y 
) const
private

Definition at line 154 of file CursedScreen.cpp.

void Screen::CleanFileToShow ( )
private

Definition at line 924 of file CursedScreen.cpp.

int Screen::Color ( int  kind,
int  sub 
) const
private

Definition at line 166 of file CursedScreen.cpp.

int Screen::ColorShred ( shred_type  type) const
private

Definition at line 201 of file CursedScreen.cpp.

void Screen::ControlPlayer ( )

Definition at line 242 of file CursedScreen.cpp.

void Screen::ControlPlayer ( int  ch)
Todo:
: ctrl-z (to background) support

Definition at line 244 of file CursedScreen.cpp.

void Screen::DeathScreen ( )
slot

Definition at line 974 of file CursedScreen.cpp.

void Screen::DisplayFile ( QString  path)
overrideslot

Definition at line 944 of file CursedScreen.cpp.

void Screen::ExamineOnNormalScreen ( int  x,
int  y,
int  z,
int  step 
) const
private

Definition at line 367 of file CursedScreen.cpp.

Block * Screen::GetFocusedBlock ( ) const
private

Returns nullptr if block is not player->Visible().

Definition at line 526 of file CursedScreen.cpp.

int Screen::GetMinimapStartX ( ) const
inlineprivate

Definition at line 672 of file CursedScreen.cpp.

int Screen::GetMinimapStartY ( ) const
inlineprivate

Definition at line 676 of file CursedScreen.cpp.

int Screen::GetNormalStartX ( ) const
inlineprivate

Definition at line 701 of file CursedScreen.cpp.

int Screen::GetNormalStartY ( ) const
inlineprivate

Definition at line 706 of file CursedScreen.cpp.

void Screen::HorizontalArrows ( WINDOW *  window,
int  y,
dirs  direction 
) const
private

Definition at line 66 of file CursedScreen.cpp.

void Screen::InventoryAction ( int  num) const
private

Definition at line 500 of file CursedScreen.cpp.

bool Screen::IsScreenWide ( )
staticprivate

Definition at line 121 of file CursedScreen.cpp.

void Screen::Move ( int  )
overrideslot

Definition at line 120 of file CursedScreen.cpp.

void Screen::MovePlayer ( dirs  dir)
private

Definition at line 227 of file CursedScreen.cpp.

void Screen::MovePlayerDiag ( dirs  dir1,
dirs  dir2 
) const
private

Definition at line 235 of file CursedScreen.cpp.

void Screen::Notify ( QString  str) const
overrideslot

Definition at line 951 of file CursedScreen.cpp.

Screen& Screen::operator= ( const Screen )
privatedelete
void Screen::PassString ( QString &  str) const
overrideslot

Definition at line 128 of file CursedScreen.cpp.

void Screen::Print ( )
overrideprivateslot

Definition at line 541 of file CursedScreen.cpp.

void Screen::PrintBar ( int  x,
int  color,
int  ch,
int  percent,
bool  value_position_right = true 
)
private

Can print health, breath and other bars on hudWin.

Definition at line 1119 of file CursedScreen.cpp.

char Screen::PrintBlock ( const Block block,
WINDOW *  window 
) const
private

Definition at line 534 of file CursedScreen.cpp.

bool Screen::PrintFile ( WINDOW *  window,
QString const &  file_name 
)
private

Returns false when file does not exist, otherwise true.

Definition at line 929 of file CursedScreen.cpp.

void Screen::PrintFront ( dirs  direction,
int  x = -1,
int  y = 0 
) const
private

Has two functions: first - when x == -1 - prints front, second - otherwise - examines block at position x, y.

Definition at line 759 of file CursedScreen.cpp.

void Screen::PrintHUD ( )
private

Definition at line 586 of file CursedScreen.cpp.

void Screen::PrintInv ( WINDOW *  window,
const Block block,
const Inventory inv 
) const
private

Definition at line 872 of file CursedScreen.cpp.

void Screen::PrintMiniMap ( )
private

Definition at line 680 of file CursedScreen.cpp.

void Screen::PrintNormal ( WINDOW *  window,
dirs  dir 
) const
private

Definition at line 711 of file CursedScreen.cpp.

void Screen::PrintQuickInventory ( )
private

Definition at line 654 of file CursedScreen.cpp.

void Screen::PrintVerticalDirection ( WINDOW *  window,
int  y,
int  x,
dirs  direction 
)
inlinestaticprivate

Definition at line 40 of file CursedScreen.cpp.

void Screen::ProcessCommand ( QString  command)
private

Definition at line 458 of file CursedScreen.cpp.

void Screen::ProcessMouse ( )
private

Definition at line 375 of file CursedScreen.cpp.

bool Screen::RandomBit ( ) const
private

Definition at line 164 of file CursedScreen.cpp.

int Screen::RandomBlink ( ) const
private

Definition at line 163 of file CursedScreen.cpp.

void Screen::RePrint ( )
private

Definition at line 95 of file CursedScreen.cpp.

void Screen::SetActionMode ( actions  mode)
private

Definition at line 484 of file CursedScreen.cpp.

void Screen::Update ( int  ,
int  ,
int   
)
overrideslot

Definition at line 117 of file CursedScreen.cpp.

void Screen::UpdateAll ( )
overrideslot

Definition at line 123 of file CursedScreen.cpp.

void Screen::UpdateAround ( int  ,
int  ,
int  ,
int   
)
overrideslot

Definition at line 119 of file CursedScreen.cpp.

void Screen::UpdatePlayer ( )
overrideslot

Definition at line 118 of file CursedScreen.cpp.

Member Data Documentation

actions Screen::actionMode
private

Definition at line 141 of file CursedScreen.h.

WINDOW*& Screen::actionWin = windows[5]
private

Definition at line 136 of file CursedScreen.h.

const QChar Screen::arrows[WEST+1]
private

Definition at line 148 of file CursedScreen.h.

const bool Screen::ascii
private

Definition at line 146 of file CursedScreen.h.

const bool Screen::beepOn
private

Definition at line 145 of file CursedScreen.h.

bool Screen::blinkOn
private

Definition at line 147 of file CursedScreen.h.

QFile* Screen::fileToShow
private

Definition at line 144 of file CursedScreen.h.

const bool Screen::flashOn
private

Definition at line 145 of file CursedScreen.h.

WINDOW*& Screen::hudWin = windows[3]
private

Definition at line 134 of file CursedScreen.h.

IThread* const Screen::input
private

Definition at line 138 of file CursedScreen.h.

bool Screen::inputActive = false
mutableprivate

Definition at line 150 of file CursedScreen.h.

QString Screen::lastNotification
mutableprivate

Definition at line 137 of file CursedScreen.h.

WINDOW*& Screen::leftWin = windows[0]
private

Definition at line 131 of file CursedScreen.h.

WINDOW*& Screen::minimapWin = windows[4]
private

Definition at line 135 of file CursedScreen.h.

FILE* const Screen::notifyLog
private

Definition at line 140 of file CursedScreen.h.

WINDOW*& Screen::notifyWin = windows[2]
private

Definition at line 133 of file CursedScreen.h.

int Screen::randomBlink
mutableprivate

Definition at line 151 of file CursedScreen.h.

WINDOW*& Screen::rightWin = windows[1]
private

Definition at line 132 of file CursedScreen.h.

SCREEN* const Screen::screen
private

Definition at line 149 of file CursedScreen.h.

int Screen::shiftFocus
private

Can be -1, 0, 1 for low, normal, and high focus.

Definition at line 143 of file CursedScreen.h.

volatile bool Screen::updated
private

Definition at line 139 of file CursedScreen.h.

WINDOW* Screen::windows[6]
private

Definition at line 130 of file CursedScreen.h.


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