summaryrefslogtreecommitdiffstats
path: root/konquest/planet_info.h
blob: c4386cee4c75a41a22bbeacee8627c41a1ce25fd (plain)
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
#ifndef _PLANET_INFO_H_
#define _PLANET_INFO_H_

#include <tqframe.h>
#include <tqstring.h>
#include <tqptrlist.h>
#include <tqpalette.h>

#include "gamecore.h"

class TQLabel;

struct planet_info_buffer {
    Planet *planet;
    int production;
    int ships;
    float killRate;
};

typedef TQPtrList<planet_info_buffer> PlanetInfoList;
typedef TQPtrListIterator<planet_info_buffer> PlanetInfoListIterator;

class PlanetInfo : public TQFrame
{
    Q_OBJECT
  TQ_OBJECT
        
public:
    PlanetInfo( TQWidget *tqparent, TQPalette palette );
    virtual ~PlanetInfo();

    void setPlanetList( PlanetList &newPlanets );
    void rescanPlanets();
    TQSize tqsizeHint() const;
    
public slots:
    void showPlanet( Planet * );

private:
    void emptyPlanetInfoList();
    void clearDisplay();
    
    PlanetList *planets;
    PlanetInfoList planet_stats;

    TQLabel *name;
    TQLabel *owner;
    TQLabel *ships;
    TQLabel *production;
    TQLabel *kill_percent;
};

#endif  // _PLANET_INFO_H_