summaryrefslogtreecommitdiffstats
path: root/pacman-c++/block.cpp
blob: 6383b3a99945833e1a91c7e31e6dddc10261d588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "block.h"
#include "constants.h"
#include <QtGui>

std::map<Color, QPixmap> Block::m_pixmaps;

Block::Block(Color color, QGraphicsItem *parent)
  : PixmapItem(parent)
{
  if (m_pixmaps.find(color) == m_pixmaps.end())
  {
    QString pixmapName = ":/" + QString("block%1").arg(color);
    m_pixmaps[color] = QPixmap(pixmapName);
  }
  setPixmap(m_pixmaps.find(color)->second);
  qDebug() << "loading block w color: " << color;
}