-
Notifications
You must be signed in to change notification settings - Fork 0
/
Board.h
35 lines (31 loc) · 814 Bytes
/
Board.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#ifndef Board_h
#define Board_h
#include <string>
#include <vector>
#include <array>
#include <iostream>
#include "Structs.h"
class Ship; //forward declaration
class Board
{
public:
Board();
~Board() {}
void drawField();
bool checkShipPosition(std::shared_ptr<struct_Point> Point, int length, bool dir);
void clearField();
bool setHorizontalVertical();
void setShips();
void setShipsRandom();
void updateField();
char getPos(std::shared_ptr<struct_Point> point);
void setPos(std::shared_ptr<struct_Point> point, char& c);
bool attack(std::shared_ptr<struct_Point> point);
bool fleetStatus();
private:
static const int boardSize = 10;
std::array<std::array<char, boardSize>, boardSize> field;
std::vector<std::shared_ptr<Ship>> shipList;
};
#endif