1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#pragma once
#include "Board.h"
#include "Ship.h"
#include <string>
#include <vector>
#include <iostream>
using namespace std;
class Player{
public:
Player(string playerName, string boardFileName);
void showBoard() const;
//Bomb getBomb() const;
//void attackBoard(const Bomb &b);
private:
string name;
Board board;
};
|
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
|
#pragma once
#include "Player.h"
#include "Ship.h"
#include <string>
#include <vector>
#include <iostream>
using namespace std;
class Ship;
class Board {
public:
Board(const string &filename);
void putShip(const Ship &s);
void moveShips();
//bool attack(const Bomb &b);
void display()const;
void show()const;
int getLines();
int getColumns();
bool checkLimits(int line, int col, const Ship &s);
private:
int numLines, numColumns;
vector<Ship> ships;
vector <vector <int> > board;
};
|
Hey there, why, when compiling I get the error that "Board does not name a type"? I have "Board.h" included. Why would this happen?
Regards
Last edited on
Last edited on
Without seeing the contents of Board.h I can only assume that the class declaration/definition is in error?