#include "Bullet.h"
#include "Tank.h"

void Bullet::fire(int bx, int by, Direction d, int dmg) {
    x = bx; y = by; dir = d; damage = dmg; isLive = true;
}

CELL_Type Bullet::peekAt(int map[MAP_CELL_NUM][MAP_CELL_NUM]) const {
    return static_cast<CELL_Type>(map[x + dx(dir)][y + dy(dir)]);
}

void Bullet::step() {
    x += dx(dir);
    y += dy(dir);
}
