/foulstate.h

http://cutefootball.googlecode.com/ · C Header · 74 lines · 43 code · 12 blank · 19 comment · 0 complexity · 2006d02e299e13e7d55fe8c8f191876e MD5 · raw file

  1. /*
  2. * Copyright 2010,2011 Timothy Rochford
  3. *
  4. * This file is part of CuteFootball.
  5. *
  6. * CuteFootball is free software: you can redistribute it and/or modify
  7. * it under the terms of the Lesser GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * CuteFootball is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * Lesser GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the Lesser GNU General Public License
  17. * along with CuteFootball. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #ifndef FOULSTATE_H
  21. #define FOULSTATE_H
  22. #include <QTimer>
  23. #include <QtGlobal>
  24. #include <QStateMachine>
  25. #include <QFinalState>
  26. #include <QGraphicsItem>
  27. #include <QStyleOptionGraphicsItem>
  28. #include <QList>
  29. #include <QGraphicsItemAnimation>
  30. #include <QDebug>
  31. class QTimeLine;
  32. class Player;
  33. class Pitch;
  34. class GameHalf;
  35. class GoalScoredState;
  36. class FoulState : public QState
  37. {
  38. Q_OBJECT
  39. public:
  40. FoulState(GameHalf *g, Pitch *p);
  41. ~FoulState();
  42. public slots:
  43. void playFrame(int frame);
  44. void prepareForFreeKick();
  45. void pauseGameClock();
  46. void continueGameClock();
  47. protected:
  48. void onEntry (QEvent* event );
  49. void onExit(QEvent* event);
  50. private:
  51. void createPlayerAnimationItems();
  52. private:
  53. Player* m_freeKickTaker;
  54. QState *m_takePositions;
  55. QState *m_takeFreeKick;
  56. QFinalState *m_allDone;
  57. GameHalf *m_game;
  58. Pitch* m_pitch;
  59. QTimeLine *m_timeLineTakePositions;
  60. QList<QGraphicsItemAnimation*> m_playerAnimationItems;
  61. };
  62. #endif // FOULSTATE_H