La simu multi-agents qui repeint une image, mais en c++ Boilerplate pompé ici : https://github.com/andrew-r-king/sfml-vscode-boilerplate
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PictureEnvironment.hpp 1005B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef PICTURE_ENVIRONMENT_H
  2. #define PICTURE_ENVIRONMENT_H
  3. #include "Platform/Platform.hpp"
  4. #include <Agents/Perception/Perception.hpp>
  5. class Agent;
  6. class PictureEnvironment
  7. { // The class
  8. public: // Access specifier
  9. std::string fFilePath;
  10. sf::RenderWindow* fWindow;
  11. util::Platform* fPlatform;
  12. const sf::Vector2f fSize;
  13. sf::Vector2f fInitialSize;
  14. sf::Event fEvent;
  15. sf::RectangleShape fShape;
  16. sf::Texture fTextureImage;
  17. sf::Image fImage;
  18. std::vector<std::unique_ptr<Agent>> fAgents;
  19. std::list<Agent>::iterator fAgentsIterator;
  20. PictureEnvironment(std::string& iFilePath, sf::RenderWindow* iWindow, util::Platform* iPlatform);
  21. void getPerception(Perception* ioPercept, int iX, int iY);
  22. void makeAgents(int iNumber);
  23. void makeRepaintAgents(int iNumber);
  24. bool paint(int iX, int iY, const sf::Color Color);
  25. uint32_t getCell(int iX, int iY);
  26. int getWidth();
  27. int getHeight();
  28. bool loop();
  29. void displayLockInput();
  30. private:
  31. PictureEnvironment();
  32. };
  33. #endif // PICTURE_ENVIRONMENT_H