Subversion Repositories spk

Rev

Rev 95 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
94 cycrow 1
#pragma once
2
 
3
#include <vector>
4
#include "spkdefines.h"
5
 
6
class CPackages;
7
 
8
namespace SPK {
9
 
10
	class CVirtualFileSystem;
11
 
12
	typedef struct SGameDir {
13
		bool			bLoad;
14
		Utils::String	dir;
15
		Utils::String	name;
16
		int				iGame;
17
		CVirtualFileSystem *pVfs;
18
//		SGameExe		*pExe;
19
	} SGameDir;
20
 
21
	tclass CGameDirectories
22
	{
23
	private:
24
		std::vector<SGameDir *> *_pDirs;
25
		SGameDir	*_pCurrentItr;
26
		SGameDir	*_pSelected;
27
		SGameDir	*_pTemporary;
28
		int			 _iLanguage;
29
 
30
	public:
31
		CGameDirectories(void);
32
		~CGameDirectories(void);
33
 
34
		bool add(const Utils::String &dir, const Utils::String &name, int iGame, const Utils::String &addon, bool bLoad);
35
		bool remove(const Utils::String &dir);
36
 
37
		bool parse(const Utils::String &data, CPackages *pPackages);
38
		bool findDir(const Utils::String &dir);
39
		bool writeData(CyStringList *lines);
40
		void updateCurrentVFS();
41
 
42
		void clear();
43
 
44
		bool setSelectedGameDirectory(int iGame, bool temp = false);
45
		bool setSelectedDirectory(const Utils::String &dir, bool temp = false);
46
		void reselectTemporaryDirectory();
47
		void setLanguage(int iLang);
48
 
49
		void setLoad(bool bLoad);
50
 
51
		bool isDir(const Utils::String &dir) const;
52
		bool hasSelected() const;
53
		bool isEmpty() const;
54
		int highestGame() const;
55
 
56
		Utils::String currentName() const;
57
		int currentGame() const;
58
		bool currentLoad() const;
59
		CVirtualFileSystem *selectedVFS() const;
60
 
61
		Utils::String findText(int iGame, int iLanguage, int iPage, int iID);
62
		Utils::String findText(int iLanguage, int iPage, int iID, Utils::String missing = Utils::String::Null());
63
 
64
		Utils::String first(int iGame = -1);
65
		Utils::String next(int iGame = -1);
66
 
67
		Utils::String firstShield();
68
		Utils::String nextShield();
69
		Utils::String firstComponentSection();
70
		Utils::String nextComponentSection();
71
		Utils::String firstDummySection();
72
		Utils::String nextDummySection();
73
		Utils::String firstBodiesSection();
74
		Utils::String nextBodiesSection();
75
		Utils::String firstCockpit();
76
		Utils::String nextCockpit();
77
		std::pair<Utils::String, Utils::String> firstLaser();
78
		std::pair<Utils::String, Utils::String> nextLaser();
79
		std::pair<Utils::String, Utils::String> firstMissile();
80
		std::pair<Utils::String, Utils::String> nextMissile();
81
 
82
	private:
83
		SGameDir *_findGameDir(int iGame) const;	
84
		SGameDir *_findGameDir(const Utils::String &dir) const;	
85
		void _add(const Utils::String &dir, const Utils::String &name, int iGame, const Utils::String &addon, bool bLoad);
86
	};
87
 
88
}