problem with bool operator in class

Hi, I'm having trouble understanding this error I'm getting in my copy constructor and my bool operator in my class methods file. Could anyone please explain to me what this mean or how I can fix it?

error C3867: 'Grid::isLegalMove': function call missing argument list; use '&Grid::isLegalMove' to create a pointer to member


grid.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include <iostream>
#include "Grid.h"
#include "DUPoint.h"
#include <vector>
#include <sstream>

using namespace std;
		
		Grid::Grid() { }

		Grid::Grid(DUPoint start, DUPoint end) 
		{
			startPos_ = start;
			endPos_ = end;
		}

		//Grid::Grid( const Grid & a ) 
		//{
		//	startPos_ = a.getStart ;
		//	endPos_ = a.getEnd ;
		//}
		//
		DUPoint Grid::getStart(DUPoint start) const 
		{
			return startPos_;
		}

		DUPoint Grid::getEnd(DUPoint end) const 
		{
			return endPos_;
		}

		void Grid::setStart(DUPoint start) 
		{
			startPos_ = start;
		}
		
		void Grid::setEnd(DUPoint end) 
		{
			endPos_ = end;
		}

		bool Grid::isLegalMove(int startPosRow, int startPosColumn,int endPosRow,int endPosColumn) 
		{
		
			if ( startPosRow < 0 || startPosRow > 3 
				 || startPosColumn < 0 || startPosColumn > 3
				 || endPosRow < 0 || endPosRow > 3 )
				 return false;
			else 
				return true;
		}
		
	void Grid::applyMove(int startPosRow, int startPosColumn, int endPosRow, int endPosColumn)
	{
		if (isLegalMove) 
                {
			startPosRow = 0;
			startPosColumn = 0;
			endPosRow = 0;
			endPosColumn = 0;
	        }else 
			exit(1);		
	}

	void Grid::output(ostream & out) {
		vector<vector<int>> grid(4);
		for(int i=0; i<4; i++)
		{
			vector<int> current(4);
			for(int j=0; j<4; j++)
			{
				current[j]=1;
			}
			grid[i] = current;
		}
	
		int rows, columns;
		out << "    0 1 2 3 " << endl;
		out << "  +---------+" <<  endl;

		for( rows=0; rows<grid.size(); ++rows ) // make each row
		{
			out << rows << " | ";		
			for( columns=0; columns<grid[rows].size(); ++columns ) //make each column
			{
				if( grid[rows][columns]==1)
				{
					out << 'X' << " ";
				}else
				{
					out << 'O' << " ";
				}
			}
			out << "| ";	
				out << endl; 
		}
		out << "  +---------+" <<  endl;
	}


grid.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
36
37
38
#ifndef _GRID_
#define _GRID_

#include "DUPoint.h"
#include <vector>
using namespace std;

class Grid
{

	public:
		
		Grid();
		Grid(DUPoint start, DUPoint end);
		Grid( const Grid & a );

		DUPoint getStart(DUPoint start) const;
		DUPoint getEnd(DUPoint end) const;

		void setStart(DUPoint start);
		void setEnd(DUPoint end);

		bool isLegalMove(int startPosRow, int startPosColumn,int endPosRow,int endPosColumn);
		void applyMove(int startPosRow, int startPosColumn, int endPosRow, int endPosColumn);

		void output(ostream & out);

	private:

		DUPoint startPos_;
		DUPoint endPos_;

		vector< vector<int> > grid_ ;



};
#endif 
1
2
3
4
5
6
7
8
9
/*void Grid::applyMove(int startPosRow, int startPosColumn, int endPosRow, int endPosColumn)
	{
		if (isLegalMove) 
                {*/

void Grid::applyMove( int start_row, int start_col, int end_row, int end_col )
	{
		if( isLegalMove( start_row, start_col, end_row, end_col ) )
                {
Topic archived. No new replies allowed.