PageRenderTime 16ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/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
21#ifndef FOULSTATE_H
22#define FOULSTATE_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 Player;
38class Pitch;
39class GameHalf;
40class GoalScoredState;
41
42class FoulState : public QState
43{
44    Q_OBJECT
45public:
46    FoulState(GameHalf *g, Pitch *p);
47    ~FoulState();
48
49public slots:
50    void playFrame(int frame);
51    void prepareForFreeKick();
52
53    void pauseGameClock();
54    void continueGameClock();
55
56protected:
57    void onEntry (QEvent* event );
58    void onExit(QEvent* event);
59
60private:
61    void createPlayerAnimationItems();
62
63private:
64    Player* m_freeKickTaker;
65    QState *m_takePositions;
66    QState *m_takeFreeKick;
67    QFinalState *m_allDone;
68    GameHalf *m_game;
69    Pitch* m_pitch;
70    QTimeLine *m_timeLineTakePositions;
71    QList<QGraphicsItemAnimation*> m_playerAnimationItems;
72};
73
74#endif // FOULSTATE_H