#include <graph.h>
|
static std::string | fileName |
|
static ThemeTypes | currentTheme = ThemeTypes::LightTheme |
|
static const std::array< std::string, 2 > | themePaths = {"lightTheme", "darkTheme"} |
|
static const std::array< Color, 2 > | backgroundColors {{{239, 239, 239, 255}, {5, 11, 30, 255}}} |
|
|
Texture2D | backArrow_Texture |
|
Texture2D | graph_Container |
|
Texture2D | cycle_Next |
|
Texture2D | cycle_Prev |
|
Texture2D | slider_Box |
|
Texture2D | auto_Button |
|
Texture2D | data_Container |
|
Vector2 | mousePos |
|
Vector2 | graphLine |
|
Vector2 | graphText |
|
Font | fontInter |
|
size_t | currentCycle |
|
unsigned int | totalAlive |
|
float | currentSense |
|
float | currentSpeed |
|
bool | autoCycle |
|
int | cycleSpeed |
|
float | fElapsedTime |
|
std::string | populationChange |
|
std::vector< ss::types::Cycle > | cycleInfo |
|
std::pair< float, float > | maxSenseAndSpeed |
|
enum ss::pl::graph::Graph::AutoState | currentAutoState = AutoState::AutoOff |
|
const std::array< std::string, 2 > | autoPaths = {"Auto_Button_Checked", "Auto_Button_Unchecked"} |
|
std::vector< ss::types::Trait > | traitData |
|
const std::array< Color, 2 > | graphColors {{{246, 245, 250, 255}, {108, 108, 108, 255}}} |
|
◆ AutoState
◆ Graph()
ss::pl::graph::Graph::Graph |
( |
std::string |
sceneName, |
|
|
SceneManager & |
sceneManager |
|
) |
| |
Constructor for the Graph class.
- Parameters
-
sceneName | The name of the current scene. Which here is "Graph". |
sceneManager | A reference to already existing SceneManager object to control the program flow. |
◆ automateCycle()
void ss::pl::graph::Graph::automateCycle |
( |
| ) |
|
|
private |
Method for automating the cycle change.
◆ calculateTraitPosition()
Vector2 ss::pl::graph::Graph::calculateTraitPosition |
( |
float |
sence, |
|
|
float |
speed |
|
) |
| |
|
private |
Method for calculating trait data position.
It returns the position in coordinates (x, y) for each trait according the the graph.
- Parameters
-
sence | It holds the current trait's sence. |
speed | It holds the current trait's speed. |
- Returns
- Vector2 of X and Y positions.
◆ checkCollision()
void ss::pl::graph::Graph::checkCollision |
( |
| ) |
|
|
private |
Method for checking the collision on click.
◆ deleteAssets()
void ss::pl::graph::Graph::deleteAssets |
( |
| ) |
|
|
virtual |
Method for deallocating the dynamically created assets.
Implements Scene.
◆ drawGraph()
void ss::pl::graph::Graph::drawGraph |
( |
| ) |
|
|
private |
Method for drawing the Graph body.
◆ drawMenu()
void ss::pl::graph::Graph::drawMenu |
( |
| ) |
|
|
private |
Method for drawing the menu in the graph page.
◆ drawTrait()
void ss::pl::graph::Graph::drawTrait |
( |
| ) |
|
|
private |
Method for drawing trait data into the graph.
It uses DrawCircleV function to draw each trait's sense and speed into the graph.
◆ getDecreasedPercentage()
float ss::pl::graph::Graph::getDecreasedPercentage |
( |
int |
lastedBef, |
|
|
int |
lastedCur |
|
) |
| |
|
inlinestatic |
Method for getting the Decreased percentage.
It returns the absolute value of the percentage when the current cycle' lasted entities had growth.
- Parameters
-
lastedBef | It holds the lasted entities in the previous cycle. |
lastedCur | it holds the lasted entities in the current cycle. |
- Returns
- The percentage when it's decreasing.
◆ getGrowthPercentage()
float ss::pl::graph::Graph::getGrowthPercentage |
( |
int |
lastedBef, |
|
|
int |
lastedCur |
|
) |
| |
|
inlinestatic |
Method for getting the Growth percentage.
It returns the absolute value of the percentage when the current cycle' lasted entities had growth.
- Parameters
-
lastedBef | It holds the lasted entities in the previous cycle. |
lastedCur | it holds the lasted entities in the current cycle. |
- Returns
- The percentage when it's growing.
◆ getHighestSense()
float ss::pl::graph::Graph::getHighestSense |
( |
const std::vector< ss::types::Cycle > & |
cycles | ) |
|
|
static |
Getter highest sense function.
Function which gets the highest sense of a generation holding in a .json file.
- Parameters
-
- Returns
- Highest sense as a float.
◆ getHighestSenseAndSpeed()
std::pair< float, float > ss::pl::graph::Graph::getHighestSenseAndSpeed |
( |
const std::vector< ss::types::Cycle > & |
cycle | ) |
|
|
private |
Function returning the highest sense and speed.
Function returning the highest sense and speed as a pair of floats.
- Parameters
-
- Returns
- A pair of floats holding sense and speed.
◆ getHighestSpeed()
float ss::pl::graph::Graph::getHighestSpeed |
( |
const std::vector< ss::types::Cycle > & |
cycles | ) |
|
|
static |
Getter highest speed function.
Function which gets the highest speed of a generation holding in a .json file.
- Parameters
-
- Returns
- Highest speed as a float.
◆ getTraitData()
void ss::pl::graph::Graph::getTraitData |
( |
size_t |
cycle | ) |
|
|
private |
Method for loading trait data.
It fills traitData vector with data from cycleInfo.traitsInfo.
- Parameters
-
cycle | it holds a iterator to the current cycle. |
◆ loadAssets()
void ss::pl::graph::Graph::loadAssets |
( |
| ) |
|
|
virtual |
Method for loading all the needed assets in the graph page.
Implements Scene.
◆ onExit()
void ss::pl::graph::Graph::onExit |
( |
| ) |
|
|
virtual |
Method which is called when we exit the program or the Graph page.
It deallocates every dynamically created object in the class' instance.
Implements Scene.
◆ Start()
void ss::pl::graph::Graph::Start |
( |
| ) |
|
|
virtual |
Method which is called in the start of the Graph page.
Implements Scene.
◆ Update()
void ss::pl::graph::Graph::Update |
( |
| ) |
|
|
virtual |
Method which is called every frame.
It updates the current scene every frame.
Implements Scene.
◆ auto_Button
Texture2D ss::pl::graph::Graph::auto_Button |
|
private |
◆ autoCycle
bool ss::pl::graph::Graph::autoCycle |
|
private |
◆ autoPaths
const std::array<std::string, 2> ss::pl::graph::Graph::autoPaths = {"Auto_Button_Checked", "Auto_Button_Unchecked"} |
|
private |
◆ backArrow_Texture
Texture2D ss::pl::graph::Graph::backArrow_Texture |
|
private |
◆ currentAutoState
◆ currentCycle
size_t ss::pl::graph::Graph::currentCycle |
|
private |
◆ currentSense
float ss::pl::graph::Graph::currentSense |
|
private |
◆ currentSpeed
float ss::pl::graph::Graph::currentSpeed |
|
private |
◆ cycle_Next
Texture2D ss::pl::graph::Graph::cycle_Next |
|
private |
◆ cycle_Prev
Texture2D ss::pl::graph::Graph::cycle_Prev |
|
private |
◆ cycleInfo
◆ cycleSpeed
int ss::pl::graph::Graph::cycleSpeed |
|
private |
◆ data_Container
Texture2D ss::pl::graph::Graph::data_Container |
|
private |
◆ fElapsedTime
float ss::pl::graph::Graph::fElapsedTime |
|
private |
◆ fileName
std::string ss::pl::graph::Graph::fileName |
|
inlinestatic |
◆ fontInter
Font ss::pl::graph::Graph::fontInter |
|
private |
◆ graph_Container
Texture2D ss::pl::graph::Graph::graph_Container |
|
private |
◆ graphColors
const std::array<Color, 2> ss::pl::graph::Graph::graphColors {{{246, 245, 250, 255}, {108, 108, 108, 255}}} |
|
private |
◆ graphLine
Vector2 ss::pl::graph::Graph::graphLine |
|
private |
◆ graphText
Vector2 ss::pl::graph::Graph::graphText |
|
private |
◆ m_sceneManager
◆ maxSenseAndSpeed
std::pair<float, float> ss::pl::graph::Graph::maxSenseAndSpeed |
|
private |
◆ mousePos
Vector2 ss::pl::graph::Graph::mousePos |
|
private |
◆ populationChange
std::string ss::pl::graph::Graph::populationChange |
|
private |
◆ slider_Box
Texture2D ss::pl::graph::Graph::slider_Box |
|
private |
◆ totalAlive
unsigned int ss::pl::graph::Graph::totalAlive |
|
private |
◆ traitData
The documentation for this class was generated from the following files: