summaryrefslogtreecommitdiff
path: root/src/graphcoloring/graphcoloring.hpp
blob: 05801dddb994adeb204d40c60c8160acbfaa136e (plain)
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
////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Leo Tenenbaum
// This file is part of GraphColoring.
//
// GraphColoring is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GraphColoring is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GraphColoring.  If not, see <https://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////


#ifndef GRAPHCOLORING_GRAPHCOLORING_H_
#define GRAPHCOLORING_GRAPHCOLORING_H_

#include "gui/window.hpp"
#include "mainmenu.hpp"
#include "levelselect.hpp"
#include "level.hpp"

namespace graphcoloring {

class GraphColoring
{
public:
	enum class State
	{
		MAIN_MENU,
		LEVEL_SELECT
	};

	GraphColoring();
	virtual ~GraphColoring();
	void Start();
	static constexpr gui::Color BACKGROUND_COLOR = 0x111111FF;

	static const std::string TITLE;
private:
	void CheckSaves(); // Makes saves directory if it does not exist.
	void DeleteAll();
	void SwitchToMainMenu();
	void SwitchToLevelSelect();
	void SwitchToLevel(std::string category_id, std::string level_id);
	State state;
	gui::Window* window;
	std::unique_ptr<MainMenu> mainMenu;
	std::unique_ptr<LevelSelect> levelSelect;
	std::unique_ptr<Level> level;
};

constexpr char PROTECT_ADD    = 'a';
constexpr char PROTECT_COLOR  = 'c';
constexpr char PROTECT_DELETE = 'd';
constexpr char PROTECT_EDGE   = 'e'; // Prevent user from adding edge to/from vertex

} // namespace graphcoloring

#endif /* GRAPHCOLORING_GRAPHCOLORING_H_ */