-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (46 loc) · 1.47 KB
/
Copy pathmain.cpp
File metadata and controls
64 lines (46 loc) · 1.47 KB
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
#include <iostream>
#include <cmath>
#include <vector>
#include <fstream>
#include <memory>
#include <random>
#include "Dependencies/eigen/Eigen/Dense"
#include <SFML/Graphics.hpp>
#include "SFML/Window/Keyboard.hpp"
#include <SFML/Window/ContextSettings.hpp>
#include <typeinfo>
#include "config.hpp"
#include "utils.hpp"
#include "NeuralNetwork.hpp"
#include "WorldObject.hpp"
#include "Creature.hpp"
#include "Hunter.hpp"
#include "Food.hpp"
#include "Manager.hpp"
#include "Plotter.hpp"
#include "SFML_Display.hpp"
int main()
{
// config::load("C:/Users/dniermann/Documents/GitHub/Cpp-Evolution/config.txt");
// sf::ContextSettings(0,0,4);
// srand(223132);
// create the display class for window and main loop
SFML_Display Display(config::WINDOW_X, config::WINDOW_Y);
// create manager
Manager M;
// create plotters
Plotter P(config::WINDOW_X - 300, config::WINDOW_Y - 40);
// add WorldObjects
// creatures, either init them randomly or load them from file
if (!config::INIT_LOAD){
print("Random init of creatures!");
M.addWorldObject<Creature>(config::S_CREATURES, M.creatures, Display.textureCreature, Display.font);
}
else{
print("Loading from file! " + config::LOAD_ID_CREATURES);
M.addWorldObject<Creature>(config::S_CREATURES, M.creatures, Display.textureCreature, Display.font, config::LOAD_ID_CREATURES);
}
// food
M.addWorldObject<Food>(config::S_FOOD, M.food, Display.textureFood, Display.font);
Display.StartMainLoop(M, P);
}