recruitmentscene.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef RECRUITMENTSCENE_H
  2. #define RECRUITMENTSCENE_H
  3. #include "gui/scene.h"
  4. #include <QWidget>
  5. #include <vector>
  6. class UnitIcon;
  7. class RaceIcon;
  8. class Player;
  9. class Unit;
  10. class Race;
  11. namespace Ui {
  12. class RecruitmentScene;
  13. }
  14. class RecruitmentScene : public Scene
  15. {
  16. Q_OBJECT
  17. public:
  18. explicit RecruitmentScene(QWidget *parent = 0);
  19. ~RecruitmentScene();
  20. void parseArgs(QString args) override;
  21. void init() override;
  22. public slots:
  23. void onUnitIconHovered(UnitIcon*);
  24. void onUnitIconUnHovered(UnitIcon*);
  25. void onUnitIconClicked(UnitIcon*);
  26. void onUnitIconDoubleClicked(UnitIcon*);
  27. void onChosenUnitIconHovered(UnitIcon*);
  28. void onChosenUnitIconUnHovered(UnitIcon*);
  29. void onChosenUnitIconClicked(UnitIcon*);
  30. void onChosenUnitIconDoubleClicked(UnitIcon*);
  31. void onRaceIconHovered(RaceIcon*);
  32. void onRaceIconUnHovered(RaceIcon*);
  33. void onRaceIconClicked(RaceIcon*);
  34. void onRaceIconDoubleClicked(RaceIcon*);
  35. void onGradeUnitIconHovered(UnitIcon*);
  36. void onGradeUnitIconUnHovered(UnitIcon*);
  37. void onGradeUnitIconClicked(UnitIcon*);
  38. void onGradeUnitIconDoubleClicked(UnitIcon*);
  39. private:
  40. void initAvailableRaces();
  41. void initAvailableUnits();
  42. void showChosenUnits();
  43. void setDescriptionTitle(QString title);
  44. void setDescriptionText(QString text);
  45. void setDescriptionIcon(QImage icon);
  46. void updateSpecsWidget(Unit* unit);
  47. void changeRace(Race* race);
  48. void setMoney(int money_);
  49. private slots:
  50. void on_back_button_clicked();
  51. void on_apply_clicked();
  52. private:
  53. int available_money_;
  54. int current_money_;
  55. int current_player_id_;
  56. Player* current_player_;
  57. Ui::RecruitmentScene *ui;
  58. UnitIcon* available_units_icons_[5];
  59. UnitIcon* chosen_units_icons_[10];
  60. RaceIcon* available_races_icons_[3];
  61. UnitIcon* prev_grade_units_icons[4];
  62. UnitIcon* next_grade_units_icons[4];
  63. };
  64. #endif // RECRUITMENTSCENE_H