| 1 |
/*************************************************************************** |
| 2 |
player.h - description |
| 3 |
------------------- |
| 4 |
begin : Sat Sep 30 2000 |
| 5 |
copyright : (C) 2000 by Waldemar Baraldi |
| 6 |
email : [email protected] |
| 7 |
***************************************************************************/ |
| 8 |
|
| 9 |
/*************************************************************************** |
| 10 |
* * |
| 11 |
* This program is free software; you can redistribute it and/or modify * |
| 12 |
* it under the terms of the GNU General Public License as published by * |
| 13 |
* the Free Software Foundation; either version 2 of the License, or * |
| 14 |
* (at your option) any later version. * |
| 15 |
* * |
| 16 |
***************************************************************************/ |
| 17 |
|
| 18 |
#ifndef PLAYER_H |
| 19 |
#define PLAYER_H |
| 20 |
|
| 21 |
#include "animatedcanvas.h" |
| 22 |
#include "pipe.h" |
| 23 |
#include "pipequeue.h" |
| 24 |
#include "eventstream.h" |
| 25 |
#include "board.h" |
| 26 |
#include "score.h" |
| 27 |
|
| 28 |
class Player : protected AnimatedCanvas{ |
| 29 |
|
| 30 |
public: |
| 31 |
|
| 32 |
static const int PlayerWidth=88; |
| 33 |
static const int PlayerHeight=240; |
| 34 |
static const int StartLives=3; |
| 35 |
static const int LivesX=10; |
| 36 |
static const int LivesY=230; |
| 37 |
static const int LivesWidth=9; |
| 38 |
static const int LivesHeight=9; |
| 39 |
|
| 40 |
Player(EventStream * es); |
| 41 |
virtual ~Player(); |
| 42 |
|
| 43 |
int width(); |
| 44 |
int height(); |
| 45 |
|
| 46 |
void setPos(int x, int y); |
| 47 |
void setStartRowColumn(int row, int column); |
| 48 |
void setBoard(Board * bd); |
| 49 |
|
| •50 |
inline void setRestrictionCoef(unsigned int coef){ |
| 51 |
queue->setRestrictionCoef(coef); |
| 52 |
} |
| 53 |
|
| 54 |
inline void setFixedCoef(unsigned int coef){ |
| 55 |
queue->setFixedCoef(coef); |
| 56 |
} |
| 57 |
|
| 58 |
void incLives(); |
| 59 |
void decLives(); |
| 60 |
unsigned int lives(); |
| 61 |
bool isChanged(); |
| 62 |
void incScore(Bonus bonus); |
| 63 |
void setRequired(int required); |
| 64 |
void incRequired(int inc); |
| 65 |
void decRequired(int dec); |
| 66 |
unsigned int scoreValue(); |
| 67 |
|
| 68 |
void play(); |
| 69 |
void paint(VideoManager * vm); |
| 70 |
void tick(); |
| 71 |
|
| 72 |
protected: |
| 73 |
|
| 74 |
unsigned int nlives; |
| 75 |
unsigned int rest_coef; |
| 76 |
unsigned int fixed_coef; |
| 77 |
int start_row, start_column; |
| 78 |
bool change; |
| 79 |
Pointer * pointer; |
| 80 |
PipeQueue * queue; |
| 81 |
EventStream * stream; |
| 82 |
Board * board; |
| 83 |
Score * score; |
| 84 |
Score * required; |
| 85 |
}; |
| 86 |
|
| 87 |
#endif |
| 88 |
|