La simu multi-agents qui repeint une image, mais en c++ Boilerplate pompé ici : https://github.com/andrew-r-king/sfml-vscode-boilerplate
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

PictureEnvironment.hpp 860B

12345678910111213141516171819202122232425262728293031323334353637
  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::list<Agent> fAgents;
  19. std::list<Agent>::iterator fAgentsIterator;
  20. PictureEnvironment(std::string& iFilePath, sf::RenderWindow* iWindow, util::Platform* iPlatform);
  21. Perception getPerception(int iX, int iY);
  22. void makeAgents(int iNumber);
  23. void paint(int iX, int iY, const sf::Color Color);
  24. bool loop();
  25. void displayLockInput();
  26. private:
  27. PictureEnvironment();
  28. };
  29. #endif // PICTURE_ENVIRONMENT_H