59 lines
853 B
C++
59 lines
853 B
C++
#include "Item.h"
|
|
|
|
Item::Item(SDL_Rect pos) {
|
|
this->pos = pos;
|
|
needs_redraw = true;
|
|
}
|
|
|
|
Item::~Item() {
|
|
}
|
|
|
|
SDL_Surface *Item::getSurface() {
|
|
return surface;
|
|
}
|
|
|
|
void Item::setSurface(SDL_Surface *surface) {
|
|
needs_redraw = true;
|
|
this->surface = surface;
|
|
}
|
|
|
|
void Item::setPos(SDL_Rect pos) {
|
|
this->pos = pos;
|
|
}
|
|
|
|
SDL_Rect *Item::getPos() {
|
|
return &pos;
|
|
}
|
|
|
|
bool Item::onMousePress(int x, int y) {
|
|
return false;
|
|
}
|
|
|
|
void Item::onMouseRelease(int x, int y) {
|
|
}
|
|
|
|
void Item::onMouseMove(int x, int y) {
|
|
}
|
|
|
|
void Item::onFingerDown(int x, int y, int finger_id) {
|
|
}
|
|
|
|
void Item::onFingerUp(int x, int y, int finger_id) {
|
|
}
|
|
|
|
bool Item::needsRedraw() {
|
|
return needs_redraw;
|
|
}
|
|
|
|
void Item::drawDone() {
|
|
needs_redraw = false;
|
|
}
|
|
|
|
void Item::setName(string name) {
|
|
this->name = name;
|
|
}
|
|
|
|
string Item::getName() {
|
|
return name;
|
|
}
|