PageRenderTime 26ms CodeModel.GetById 21ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/kickoffstate.h

http://cutefootball.googlecode.com/
C++ Header | 80 lines | 46 code | 15 blank | 19 comment | 0 complexity | ebe4dcb05021874e9d7eabfcbc9c0e27 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
21#ifndef KICKOFFSTATE_H
22#define KICKOFFSTATE_H
23
24#include <QTimer>
25#include <QtGlobal>
26#include <QStateMachine>
27#include <QFinalState>
28
29#include <QGraphicsItem>
30#include <QStyleOptionGraphicsItem>
31#include <QList>
32#include <QGraphicsItemAnimation>
33#include <QDebug>
34
35class QTimeLine;
36
37class Pitch;
38class GameHalf;
39class Team;
40class Player;
41
42class KickOffState : public QState
43{
44    Q_OBJECT
45
46public:
47    explicit KickOffState(GameHalf *g, Pitch *p, QObject *parent = 0);
48    ~KickOffState();
49
50public slots:
51    void playFrame(int frame);
52    void prepareForKickOff();
53    void setTeamToKickOff(Team*);
54
55    void pauseGameClock();
56    void continueGameClock();
57
58protected:
59    void onEntry (QEvent* event );
60    void onExit(QEvent* event);
61
62private:
63    void createPlayerAnimationItems();
64
65private:
66    QState *m_takePositions;
67    QState *m_takeKickOff;
68    QFinalState *m_allDone;
69    Pitch* m_pitch;
70    GameHalf* m_game;
71    QTimeLine *m_timeLineTakePositions;
72    QList<QGraphicsItemAnimation*> m_playerAnimationItems;
73
74    Player* m_kickOffPlayer; // NOT OWNED
75    Player* m_kickOffSupportPlayer; // NOT OWNED
76
77    Team* m_teamToKickOff; // NOT OWNED
78};
79
80#endif // KICKOFFSTATE_H