| 1 | /*************************************************************************** |
| 2 | score.h - description |
| 3 | ------------------- |
| 4 | begin : Sun Mar 11 2001 |
| 5 | copyright : (C) 2001 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 SCORE_H |
| 19 | #define SCORE_H |
| 20 | |
| 21 | #include "animatedcanvas.h" |
| 22 | |
| 23 | class Score : public AnimatedCanvas{ |
| 24 | |
| 25 | public: |
| 26 | |
| 27 | Score(int value=0); |
| 28 | virtual ~Score(); |
| 29 | |
| 30 | void inc(unsigned int value); |
| 31 | |
| 32 | void dec(unsigned int value); |
| 33 | |
| 34 | void sumUp(); |
| 35 | |
| 36 | int getValue(); |
| 37 | |
| 38 | bool isChanged(); |
| 39 | |
| 40 | void paint(VideoManager * vm); |
| 41 | |
| 42 | void tick(); |
| 43 | |
| 44 | private: |
| 45 | static const unsigned int TickValue=1; |
| 46 | static const unsigned int ScoreWidth = 80; |
| 47 | static const unsigned int ScoreHeight = 15; |
| 48 | static const unsigned int Digits = 8; |
| 49 | |
| 50 | unsigned int value; |
| 51 | int delta; |
| 52 | bool changed; |
| 53 | }; |
| 54 | |
| 55 | #endif |
| 56 |