first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
//Bomb.hpp
|
||||
#pragma once
|
||||
#include "Position.hpp"
|
||||
#include <iostream>
|
||||
|
||||
class Bomb {
|
||||
private:
|
||||
Position _position;
|
||||
unsigned short _timer;
|
||||
bool _active;
|
||||
public:
|
||||
Bomb(): _position({0, 0}), _timer(3), _active(false) {
|
||||
std::cout << "Bomb created at default position " << std::endl;
|
||||
};
|
||||
|
||||
Bomb(Position position) : _position(position), _timer(3), _active(false) {
|
||||
std::cout << "Bomb created at " << position << std::endl;
|
||||
}
|
||||
|
||||
void activate() { _active = true; }
|
||||
void deactivate() { _active = false; }
|
||||
bool isActive() const { return _active; }
|
||||
|
||||
void setPosition(Position position) { _position = position; }
|
||||
Position getPosition() const { return _position; }
|
||||
|
||||
unsigned short getTimer() const { return _timer; }
|
||||
};
|
||||
Reference in New Issue
Block a user