diff options
| author | manuel <manuel@mausz.at> | 2011-04-13 17:41:28 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-13 17:41:28 +0200 |
| commit | 3d20638fa8e295271ce38953ad1c657d9275bd99 (patch) | |
| tree | 66cc9f2c3cc1e8772cb99b27b0c20ec8067ff80f /pacman-c++/block.cpp | |
| parent | 2c351a8bccdfe0fe9ad0ccb4dba5e15ef23b4c0c (diff) | |
| download | foop-3d20638fa8e295271ce38953ad1c657d9275bd99.tar.gz foop-3d20638fa8e295271ce38953ad1c657d9275bd99.tar.bz2 foop-3d20638fa8e295271ce38953ad1c657d9275bd99.zip | |
some speed improvments regarding protobuf
Diffstat (limited to 'pacman-c++/block.cpp')
| -rw-r--r-- | pacman-c++/block.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp index 083b203..c6aaa73 100644 --- a/pacman-c++/block.cpp +++ b/pacman-c++/block.cpp | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include "block.h" | 1 | #include "block.h" |
| 2 | #include "constants.h" | 2 | #include "constants.h" |
| 3 | #include "actor.h" | ||
| 3 | #include <QtDebug> | 4 | #include <QtDebug> |
| 4 | 5 | ||
| 5 | QMap<Color::Color, QPixmap> Block::m_pixmaps; | 6 | QMap<Color::Color, QPixmap> Block::m_pixmaps; |
| @@ -25,3 +26,17 @@ void Block::setNeighbours(unsigned int neighbours) | |||
| 25 | { | 26 | { |
| 26 | setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height); | 27 | setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height); |
| 27 | } | 28 | } |
| 29 | |||
| 30 | bool Block::checkEnter(Actor * /* actor */) | ||
| 31 | { | ||
| 32 | return (m_color != Color::none); | ||
| 33 | } | ||
| 34 | |||
| 35 | bool Block::enter(Actor *actor) | ||
| 36 | { | ||
| 37 | if (m_color != actor->color()) | ||
| 38 | { | ||
| 39 | //TODO: actor dies + game ends | ||
| 40 | } | ||
| 41 | return true; | ||
| 42 | } | ||
