Library for 3.2'' uLcd Picaso Display4D system Picaso Serial Environment Command Set web: http://www.4dsystems.com.au/product/20/67/Processors_Graphics/PICASO/
Player.cpp@1:a74e42cf52b2, 2015-04-05 (annotated)
- Committer:
- adelino
- Date:
- Sun Apr 05 13:54:48 2015 +0000
- Revision:
- 1:a74e42cf52b2
PicasoLib version 2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adelino | 1:a74e42cf52b2 | 1 | #include "Player.h" |
adelino | 1:a74e42cf52b2 | 2 | |
adelino | 1:a74e42cf52b2 | 3 | //---------------------------------------------- |
adelino | 1:a74e42cf52b2 | 4 | Player::Player(string _strName):myName(_strName) |
adelino | 1:a74e42cf52b2 | 5 | { |
adelino | 1:a74e42cf52b2 | 6 | myLives=0; |
adelino | 1:a74e42cf52b2 | 7 | myScore=0; |
adelino | 1:a74e42cf52b2 | 8 | myCount=0; |
adelino | 1:a74e42cf52b2 | 9 | } |
adelino | 1:a74e42cf52b2 | 10 | //------------------------------------------------ |
adelino | 1:a74e42cf52b2 | 11 | Player::~Player(void) |
adelino | 1:a74e42cf52b2 | 12 | { |
adelino | 1:a74e42cf52b2 | 13 | } |
adelino | 1:a74e42cf52b2 | 14 | //------------------------------------------------ |
adelino | 1:a74e42cf52b2 | 15 | string Player::getName(void)const |
adelino | 1:a74e42cf52b2 | 16 | { |
adelino | 1:a74e42cf52b2 | 17 | /* |
adelino | 1:a74e42cf52b2 | 18 | for(int i=0;i<10;i++) |
adelino | 1:a74e42cf52b2 | 19 | { |
adelino | 1:a74e42cf52b2 | 20 | str[i]=myName[i]; |
adelino | 1:a74e42cf52b2 | 21 | } |
adelino | 1:a74e42cf52b2 | 22 | */ |
adelino | 1:a74e42cf52b2 | 23 | return myName; |
adelino | 1:a74e42cf52b2 | 24 | } |
adelino | 1:a74e42cf52b2 | 25 | //------------------------------------------------ |
adelino | 1:a74e42cf52b2 | 26 | int Player::getLives(void) const |
adelino | 1:a74e42cf52b2 | 27 | { |
adelino | 1:a74e42cf52b2 | 28 | return this->myLives; |
adelino | 1:a74e42cf52b2 | 29 | } |
adelino | 1:a74e42cf52b2 | 30 | //------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 31 | int Player::getScore(void) const |
adelino | 1:a74e42cf52b2 | 32 | { |
adelino | 1:a74e42cf52b2 | 33 | return this->myScore; |
adelino | 1:a74e42cf52b2 | 34 | } |
adelino | 1:a74e42cf52b2 | 35 | //-------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 36 | int Player::getCount(void) const |
adelino | 1:a74e42cf52b2 | 37 | { |
adelino | 1:a74e42cf52b2 | 38 | return this->myCount; |
adelino | 1:a74e42cf52b2 | 39 | } |
adelino | 1:a74e42cf52b2 | 40 | //----------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 41 | void Player::setLives(int _lives) |
adelino | 1:a74e42cf52b2 | 42 | { |
adelino | 1:a74e42cf52b2 | 43 | myLives=_lives; |
adelino | 1:a74e42cf52b2 | 44 | } |
adelino | 1:a74e42cf52b2 | 45 | //---------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 46 | void Player::setScore(int _score) |
adelino | 1:a74e42cf52b2 | 47 | { |
adelino | 1:a74e42cf52b2 | 48 | myScore=_score; |
adelino | 1:a74e42cf52b2 | 49 | } |
adelino | 1:a74e42cf52b2 | 50 | //----------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 51 | void Player::setCount(int _count) |
adelino | 1:a74e42cf52b2 | 52 | { |
adelino | 1:a74e42cf52b2 | 53 | myCount=_count; |
adelino | 1:a74e42cf52b2 | 54 | } |
adelino | 1:a74e42cf52b2 | 55 | //----------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 56 | void Player::incCount(void) |
adelino | 1:a74e42cf52b2 | 57 | { |
adelino | 1:a74e42cf52b2 | 58 | myCount=myCount+1; |
adelino | 1:a74e42cf52b2 | 59 | } |
adelino | 1:a74e42cf52b2 | 60 | //----------------------------------------------------- |
adelino | 1:a74e42cf52b2 | 61 | void Player::decLives(void) |
adelino | 1:a74e42cf52b2 | 62 | { |
adelino | 1:a74e42cf52b2 | 63 | myLives=myLives-1; |
adelino | 1:a74e42cf52b2 | 64 | |
adelino | 1:a74e42cf52b2 | 65 | } |
adelino | 1:a74e42cf52b2 | 66 | //----------------------------------------------------- |