This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/items/Gadget.cpp

28 lines
429 B
C++

/*
* Gadget.cpp
*
* Created on: 06.07.2013
* Author: Felix
*/
#include "Gadget.h"
#include "../abstract/Character.h"
Gadget::Gadget(std::string name) :
Item(sf::Vector2f(32, 32), "item.png"),
mName(name) {
}
void
Gadget::use(Character& character) {
if (mCooldownTimer.isExpired()) {
onUse(character);
mCooldownTimer.restart(getCooldownTime());
}
}
std::string
Gadget::getName() const {
return mName;
}