class Case : public MultiAnim

Main class to define the properties of a square in the game array

Inheritance:


Public Methods

Case() throw()
The constructor does nothing
virtual ~Case() throw()
The destructor does nothing
virtual void move(int niv, int j, int i, int jMult, int iMult) throw()
Sets the position of the Case in the Grille, but not interacts with the Grille (only sets the positions - niv,jc,ic members)
virtual void getPos(int& niv, int& j, int& i) const throw()
Returns the positions of the Case :
bool virtual traversable(bool force) throw()
Used to define the properties of the Case : 'traversable' with force==false means : a Bonhomme can pass through the Case without any problem
virtual void action(Bonhomme20& bonhomme) throw()
Function called when the Bonhomme 'bonhomme' passes on the Case (the positions used are the 'action' positions of the Bonhomme - normally, the most external)
virtual void tolerantAction(Bonhomme20& bonhomme) throw()
Function called when the Bonhomme 'bonhomme' passes on the Case (the positions used are the 'tolerantAction' positions of the Bonhomme - normally, the most internal)
bool virtual toBeBlownUp() const throw()
Used to say to the manager (usually Grille) if this Case has to be removed
bool virtual blowable() throw()
Another property of the Case : 'blowable' means 'can blow up' (a bomb for example)
bool virtual getTraverseMur() const throw()
A function wich must be derived to define CaseBombe for example : defines special properties of the Case
int virtual getPuissance() const throw()
A function wich must be derived to define CaseBombe for example : defines special properties of the Case
bool virtual haveToActivateUnder() throw()
Used when the Case is on another in the Grille (it hides the other)
bool virtual haveToUnactivateUnder() throw()
Used when the Case is on another in the Grille (it hides the other)
bool virtual restricted() const throw()
Another property of the Case : 'restricted' means 'only another restricted Case can be put on it' (a flam for example)
bool virtual stackable() const throw()
Another property of the Case : 'stackable' means 'only a restricted Case can be put on it' (a wall is not stackable for example, a flam is restricted)
bool virtual high() const throw()
Another property of the Case : 'high' means 'occupies entirely the level in the Grille' (a wall for example)
bool virtual fallable() const throw()
Another property of the Case : 'fallable' means 'when there is nothing under it, the Case falls' (a bomb for example, not a flam)
bool virtual paintedUp() throw()
Another property of the Case : 'paintedUp' means 'painted on the others Case and on the Bonhommes'

Protected Fields

int niv
Define the level position of the Case in the array of the game (managed by a Grille) - in french, level is 'niveau' -
int jc
Define the vertical position of the Case in the array of the game (managed by a Grille)
int ic
Define the horizontal position of the Case in the array of the game (managed by a Grille)

Private Methods

Case(Case& c) throw()
Forbidden to copy like that (function declared but not defined)

Inherited from MultiAnim:

Public Methods

void virtual setOn() throw()
void virtual setUppest() throw()
void virtual setTo() throw()
void virtual setUnder() throw()
void virtual setPalette(const PixelPalette& pal) throw()
void virtual paint(WindowPipe& windowPipe) throw()
void virtual reinit() throw()
void virtual keyAction(const Key& key) throw()
int virtual add(Anim& anim) throw()
void virtual on(int id) throw(Exception)
Anim* getAnim(int id) throw(Exception)
void virtual setColor(Pixel col) throw()
void virtual restoreColor() throw()
int getCurrent() throw()
void getSize(int& j, int& i) const throw()

Protected Fields

Anim** tab
int length
Tji pos
Anim* activeAnim
Pixel color
bool colored
bool _on
bool to
bool under
const PixelPalette* pal
int currentAnim
bool uppest

Protected Methods

int virtual virtualWalk() throw()

Inherited from Pageable:


Inherited from Walkable:

Public Methods

int walk() throw(Exception)
int getSlow() const throw()
virtual void setSlow(int slow) throw()

Protected Fields

int s
int t
int returnWalk

Inherited from Paintable:


Inherited from Reinitable:


Inherited from Keyable:


Inherited from Activable:

Public Methods

void virtual activate() throw()
void virtual unactivate() throw()
bool virtual isActive() const throw()

Protected Fields

bool active

Inherited from Movable:


Documentation

Main class to define the properties of a square in the game array. - Case is a french word for a square in an array. This class define a default square of the Grille (in english : Wire or Array) in a game. The goal is : when you want to define a new specification of a square, you must derive the methods 'traversable', 'blowable', etc. For example, a MurIndestructible (in english : indestructible wall) is not 'traversable'.
Case(Case& c) throw()
Forbidden to copy like that (function declared but not defined)

int niv
Define the level position of the Case in the array of the game (managed by a Grille) - in french, level is 'niveau' -

int jc
Define the vertical position of the Case in the array of the game (managed by a Grille)

int ic
Define the horizontal position of the Case in the array of the game (managed by a Grille)

Case() throw()
The constructor does nothing

virtual ~Case() throw()
The destructor does nothing

virtual void move(int niv, int j, int i, int jMult, int iMult) throw()
Sets the position of the Case in the Grille, but not interacts with the Grille (only sets the positions - niv,jc,ic members)
Parameters:
niv - the level (normally, the Grille manages two levels, so 0 <= niv < 2)
j - the vertical position in the array of the game (managed by a Grille)
i - the horizontal position in the array
jMult - this integer defines the vertical size of a square in the screen (normally 20), it is necessary in order to print the Case on the screen
iMult - this integer defines the horizontal size of a square in the screen (normally 20), it is necessary in order to print the Case on the screen

virtual void getPos(int& niv, int& j, int& i) const throw()
Returns the positions of the Case :
Parameters:
niv - level in the Grille
j - vertical position in the array of the game (managed by a Grille)
i - horizontal position in the array of the game (managed by a Grille)

bool virtual traversable(bool force) throw()
Used to define the properties of the Case : 'traversable' with force==false means : a Bonhomme can pass through the Case without any problem. 'traversable' with force==true means : a Bonhomme can pass through the Case forcing (with special option for example).
Returns:
true
Parameters:
force - enable to give two senses for this function (the weak sense and the hard sense)

virtual void action(Bonhomme20& bonhomme) throw()
Function called when the Bonhomme 'bonhomme' passes on the Case (the positions used are the 'action' positions of the Bonhomme - normally, the most external)
Parameters:
bonhomme - the Bonhomme who walks on this Case and perform the action

virtual void tolerantAction(Bonhomme20& bonhomme) throw()
Function called when the Bonhomme 'bonhomme' passes on the Case (the positions used are the 'tolerantAction' positions of the Bonhomme - normally, the most internal)
Parameters:
bonhomme - the Bonhomme who walks on this Case and perform the action

bool virtual toBeBlownUp() const throw()
Used to say to the manager (usually Grille) if this Case has to be removed

bool virtual blowable() throw()
Another property of the Case : 'blowable' means 'can blow up' (a bomb for example)
Returns:
false

bool virtual getTraverseMur() const throw()
A function wich must be derived to define CaseBombe for example : defines special properties of the Case

int virtual getPuissance() const throw()
A function wich must be derived to define CaseBombe for example : defines special properties of the Case

bool virtual haveToActivateUnder() throw()
Used when the Case is on another in the Grille (it hides the other). Used when a wall is broken, to activate the options under it.
Returns:
false

bool virtual haveToUnactivateUnder() throw()
Used when the Case is on another in the Grille (it hides the other). Used when a wall is restore for example, to unactivate the options under it.
Returns:
false

bool virtual restricted() const throw()
Another property of the Case : 'restricted' means 'only another restricted Case can be put on it' (a flam for example)
Returns:
false

bool virtual stackable() const throw()
Another property of the Case : 'stackable' means 'only a restricted Case can be put on it' (a wall is not stackable for example, a flam is restricted)
Returns:
true

bool virtual high() const throw()
Another property of the Case : 'high' means 'occupies entirely the level in the Grille' (a wall for example)
Returns:
false

bool virtual fallable() const throw()
Another property of the Case : 'fallable' means 'when there is nothing under it, the Case falls' (a bomb for example, not a flam)
Returns:
true

bool virtual paintedUp() throw()
Another property of the Case : 'paintedUp' means 'painted on the others Case and on the Bonhommes'
Returns:
false


Direct child classes:
CaseOption
CaseMurIndestructible
CaseMur
CaseJoli
CaseFlamme
CaseEscalier
CaseBoue
CaseBombe
Author:
David FAUTHOUX
See Also:
Grille
Bonhomme20
CaseId

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de