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

29 lines
431 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(40, 40), "gadget.png"),
mName(name) {
}
void
Gadget::use(Character& character) {
if (mCooldownTimer.isExpired()) {
onUse(character);
mCooldownTimer.restart(getCooldownTime());
}
}
std::string
Gadget::getName() const {
return mName;
}