Brak opisu

flag.cpp 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "flag.h"
  2. ///
  3. /// Default constructor. The properties for the checkpoints are set as follows:
  4. /// * x_flag: x coordinates where the checkpoint will be placed
  5. /// * y_flag: y coordinates where the checkpoint will be placed
  6. /// * name: Sets the image that will be used for the checkpoint
  7. ///
  8. Flag::Flag(QWidget *parent) :
  9. QWidget(parent)
  10. {
  11. x_flag = 250;
  12. y_flag = 140;
  13. name = ":/resources/flag.png";
  14. }
  15. ///
  16. /// Setter for the image of the checkpoint that will be used
  17. ///
  18. void Flag::setFlag(string arg){
  19. name = arg;
  20. }
  21. ///
  22. /// Getter for the image of the checkpoint
  23. ///
  24. string Flag::getFlag(){
  25. return name;
  26. }
  27. ///
  28. /// Setter for the X coordinates of the checkpoint
  29. ///
  30. void Flag::setXFlag(int arg){
  31. x_flag = arg;
  32. }
  33. ///
  34. /// Setter for the Y coordinates of the checkpoint
  35. ///
  36. void Flag::setYFlag(int arg){
  37. y_flag = arg;
  38. }
  39. ///
  40. /// Getter for the X coordinates of the checkpoint
  41. ///
  42. int Flag::getXFlag(){
  43. return x_flag;
  44. }
  45. ///
  46. /// Getter for the Y coordinates of the checkpoint
  47. ///
  48. int Flag::getYFlag(){
  49. return y_flag;
  50. }
  51. void Flag::hide(){
  52. setXFlag(630);
  53. }