Civilization
GraphicCard.hpp
1 // Generated by dia2code
2 #ifndef CLIENT__GRAPHICCARD__H
3 #define CLIENT__GRAPHICCARD__H
4 
5 #include <memory>
6 #include <SFML/Graphics.hpp>
7 #include <string>
8 #include <array>
9 #include <json/json.h>
10 
11 namespace client {
12  class TextureDisplayer;
13  class Button;
14 }
15 
16 #include "TextureDisplayer.hpp"
17 #include "Button.hpp"
18 
19 namespace client {
20 
22  class GraphicCard {
23  // Associations
24  // Attributes
25  public:
26  std::unique_ptr<client::TextureDisplayer> texture;
27  std::unique_ptr<sf::Text> title;
28  std::string type;
29  std::array<std::string, 4> allBodiesString;
30  std::unique_ptr<sf::Text> body;
31  int level = 0;
32  int bonus;
33  bool isUp = false;
34  std::unique_ptr<sf::Text> nbOfBoxesText;
35  float priorityScale;
36  float upScaleProportion;
37  int yBodyOffset;
38  int windowWidth;
39  int windowLength;
40  std::unique_ptr<Button> validateButton;
41  int difficulty;
42  // Operations
43  public:
44  GraphicCard (const std::string& path, const Json::Value& dataNumber, const float windowLength, const float windowWidth, int index, sf::Font& font);
45  GraphicCard (const std::string& path, float actionProportion, const float windowLength, const float windowWidth, int actionCardNumber, int index);
46  void moveUpPriorityCard ();
47  void movePriorityCardElements (const Json::Value& dataNumber);
48  void setPositionPriorityCardTexts (sf::Text& text, int refXOffset, int refYOffset, int xOffset, int yOffset);
49  // Setters and Getters
50  };
51 
52 };
53 
54 #endif
class GraphicCard -
Definition: GraphicCard.hpp:22
void moveUpPriorityCard()
Move up a priority card when we click on it.
Definition: GraphicCard.cpp:62
void setPositionPriorityCardTexts(sf::Text &text, int refXOffset, int refYOffset, int xOffset, int yOffset)
Set position of all the different texts on a priority card.
Definition: GraphicCard.cpp:96
void movePriorityCardElements(const Json::Value &dataNumber)
Move all the elements of a priority card if we move one (title, body, play button,...
Definition: GraphicCard.cpp:109