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
429 B
C++
Raw Normal View History

2013-07-06 19:21:25 +00:00
/*
* Gadget.cpp
*
* Created on: 06.07.2013
* Author: Felix
*/
#include "Gadget.h"
#include "../abstract/Character.h"
2013-07-10 21:41:24 +00:00
Gadget::Gadget(std::string name) :
2013-08-18 12:27:59 +00:00
Item(sf::Vector2f(32, 32), "item.png"),
2013-07-10 21:41:24 +00:00
mName(name) {
}
2013-07-06 19:21:25 +00:00
void
Gadget::use(Character& character) {
if (mCooldownTimer.isExpired()) {
onUse(character);
mCooldownTimer.restart(getCooldownTime());
}
}
2013-07-10 21:41:24 +00:00
std::string
Gadget::getName() const {
return mName;
}