-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbargamepiece.cpp
More file actions
40 lines (31 loc) · 774 Bytes
/
bargamepiece.cpp
File metadata and controls
40 lines (31 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "bargamepiece.h"
#include "gameview.h"
#include "gamepiece.h"
/**
* Author: Yunus Rahbar
* Date: 6/10/13
*
*/
/**
* BarGamePiece
* A Game Piece which can be dropped onto the gameView to create a new game piece
*
*/
BarGamePiece::BarGamePiece(QString imageName, GameView * view, QWidget *parent)
: BarItem(imageName,parent), gameView(view)
{
}
/**
* Create a new piece when dropped
*
*/
void BarGamePiece::dropAction(QPoint p)
{
if (gameView) {
//GamePiece * piece = new GamePiece(this->parentWidget());
//piece->setPixmap(this->image);
//piece->resize(piece->pixmap()->size());
//gameView->addGamePiece(image,mapToGlobal(p));
gameView->sendPieceCreated(imgPath,mapToGlobal(p));
}
}