File: fishes.h

package info (click to toggle)
kaquarium 1.0-beta-6.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,944 kB
  • ctags: 313
  • sloc: sh: 17,170; perl: 2,724; cpp: 1,340; makefile: 116
file content (80 lines) | stat: -rw-r--r-- 1,543 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef __FISHES_H__
#define __FISHES_H__

#include <qobject.h>
#include <qstring.h>
#include <qcanvas.h>
#include <qstring.h>
#include <qdict.h>

class QTimer;

class fishSprite : public QObject, public QCanvasSprite
{
  Q_OBJECT
public:
    fishSprite( QCanvas *, QCanvasPixmapArray *, QObject * = 0, const char * = 0 );
    ~fishSprite();
    
    void init();
    void advance( int phase );
    
protected slots:
    void slotResized();
    void slotSettingsChanged();
    
private:
    enum fishDirections { Right = 0, Left};
    
    // Position
    int posx;
    int fishEndPosX;
    int posy;
    int posyupdown;
    
    
    // Direction
    fishDirections fishDirection;
    
    // Animation Frame
    int fishFrame; // pos in animate fish pic
    int fishFramesDir; // // how much animated pics i have in a direction
    int fishFrameAdd;
    int fishFrameDelay; // how much a same frame will be showed

    // well well!
    int mid_imagex;
    int mid_imagey;
    
};

class kfishManager : public QObject
{
    Q_OBJECT
public:
    kfishManager( QObject * = 0, const char * = 0);
    ~kfishManager();

signals:
    void signalResized();
    
public slots:
    void slotSettingsChanged();

private:
    void addFish(QString);
    
    void loadFishes();
    void showFishes();

    QCanvasPixmapArray *getFishAnimation(QString, int, int, int num, Qt::Orientation, int);
    
    int oldScale;
    int OldNumFishes;
    
    QDict<QCanvasPixmapArray> m_listFishesAnim;
    QDict<fishSprite> m_fish;
};

// swordfish 55 110
#endif