-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
43 lines (34 loc) · 926 Bytes
/
graph.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
39
40
41
42
43
#pragma once
#ifndef GRAPH_H
#define GRAPH_H
/*
* This is a class for game logic. It provides a graph for the board.
*
*/
#include <QVector>
#include <iostream>
#include "node.h"
class Graph {
public:
Graph();
Graph(int length);
//Graph(Graph& G);
~Graph();
void initialise_length(int length);
int get_length();
int vertex_count();
int edge_count();
bool adjacent(int x, int y);
QVector<int> neighbours(int x);
void add_edge(int x, int y);
void delete_edge(int x, int y);
Colour get_node_value(int x);
void set_colour(int x, Colour c);
QVector<Colour> get_node_values();
void set_node_values(QVector<Colour> node_values); // for testing purposes only
private:
int length;
QVector<QVector<bool> > graph;
QVector<Colour> node_values;
};
#endif // GRAPH_H