From ce48af53646cd9e7ec762fc1ac176b3aa620b11d Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 5 May 2011 00:57:07 +0200 Subject: - refactorized the whole project and made a few subprojects - replaced tcp with enet - added connect dialog - some smaller bugfixes --- pacman-c++/block.cpp | 56 ---------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 pacman-c++/block.cpp (limited to 'pacman-c++/block.cpp') diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp deleted file mode 100644 index 7f9dd14..0000000 --- a/pacman-c++/block.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "block.h" -#include "constants.h" -#include "actor.h" -#include "util.h" -#include - -QMap Block::m_pixmaps; - -Block::Block(Color::Color color, unsigned int neighbours, QGraphicsItem *parent) - : GameEntity(color, parent), m_neighbours(neighbours) -{ - m_type = Type; - - /* empty object for servers */ - if (Constants::server) - return; - - if (m_pixmaps.find(color) == m_pixmaps.end()) - { - unsigned int colid = (color == Color::none) ? 0 : Util::floorLog2(color) + 1; - QString pixmapName = ":/" + QString("block%1").arg(colid); - m_pixmaps[color] = QPixmap(pixmapName); - } - setPixmap(m_pixmaps.find(color).value()); - setNeighbours(m_neighbours); -} - -unsigned int Block::neighbours() -{ - return m_neighbours; -} - -void Block::setNeighbours(unsigned int neighbours) -{ - m_neighbours = neighbours; - setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height); -} - -bool Block::checkEnter(Actor * /* actor */) -{ - if (m_color == Color::none) - return false; - return true; -} - -GameEntity::EnteredState Block::enter(Actor *actor) -{ - if (m_color != Color::none && m_color != actor->color()) - return DestroyedActor; - return Nothing; -} - -void Block::onDie(Actor *actor) -{ - actor->die(); -} -- cgit v1.2.3