first commit
[blok] / totemblokitem.cpp
diff --git a/totemblokitem.cpp b/totemblokitem.cpp
new file mode 100644 (file)
index 0000000..73d36a7
--- /dev/null
@@ -0,0 +1,33 @@
+#include "totemblokitem.h"
+
+TotemBlokItem::TotemBlokItem(int width,int height,QObject *parent) :
+        BlokItem(width, height,parent)
+{
+    setTotem(YELLOW_TOTEM);
+}
+
+
+void TotemBlokItem::setTotem(Totem _totem)
+{
+    mCurrentTotem = _totem;
+
+    if ( mCurrentTotem == YELLOW_TOTEM)
+    {
+        setBrush(QBrush(QPixmap(":sprites/totem1_block.png")));
+    }
+
+    if ( mCurrentTotem == BLUE_TOTEM)
+    {
+        setBrush(QBrush(QPixmap(":sprites/totem2_block.png")));
+
+    }
+
+    if ( mCurrentTotem == RED_TOTEM)
+    {
+        setBrush(QBrush(QPixmap(":sprites/totem3_block.png")));
+
+    }
+
+
+
+}