-
Notifications
You must be signed in to change notification settings - Fork 4
/
tibiafile.h
91 lines (75 loc) · 2.07 KB
/
tibiafile.h
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
81
82
83
84
85
86
87
88
89
90
91
#ifndef TIBIAFILE_H
#define TIBIAFILE_H
#include <QFile>
#include <QDataStream>
class TibiaItem;
class TibiaSprite;
class ItemFile;
class SpriteFile;
class PictureFile;
class TibiaModule;
class TibiaFile : public QFile
{
Q_OBJECT
public:
TibiaFile( QObject *parent );
virtual ~TibiaFile() {};
virtual bool createNew( void ) {
return false;
};
virtual bool isLoaded( void ) const {
return false;
};
virtual void unload( void );
virtual bool load( const QString& ) = 0;
virtual bool save( const QString& ) = 0;
virtual bool idle( const QString&, bool ) = 0;
virtual ItemFile *getItemFile() {
return NULL;
};
virtual const ItemFile *getItemFile() const {
return NULL;
};
virtual SpriteFile *getSpriteFile() {
return NULL;
};
virtual const SpriteFile *getSpriteFile() const {
return NULL;
};
virtual PictureFile *getPictureFile() {
return NULL;
};
virtual const PictureFile *getPictureFile() const {
return NULL;
};
virtual TibiaModule *getTibiaModule() {
return NULL;
};
virtual const TibiaModule *getTibiaModule() const {
return NULL;
};
static quint32 peekSignature( const QString& fileName );
static void readSprite( QDataStream& in, TibiaSprite& sprite, quint32 offset_x, quint32 offset_y, bool read_rgb = true );
static void writeSprite( QDataStream& out, const TibiaSprite& sprite, quint32 offset_x, quint32 offset_y, quint32& dumpOffset, bool write_rgb = true );
quint32 getSignature( void ) const {
return m_signature;
};
void setSignature( quint32 signature ) {
m_signature = signature;
};
bool isIdle( void ) const {
return m_idle;
};
signals:
void parseError( QString, QFile::FileError );
void documentError( QString, QString, int );
private:
quint32 m_signature;
bool m_idle;
friend class SpriteFile;
friend class ItemFile;
friend class PictureFile;
friend class ExternalFile;
friend class LibraryFile;
};
#endif