mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-09-01 15:09:19 +00:00
upload "kind" alien swarm
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#ifndef CASW_KEYVALUESDATABASE_H
|
||||
#define CASW_KEYVALUESDATABASE_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "utlvector.h"
|
||||
|
||||
class KeyValues;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// A generic database which recursively loads all .txt files in a folder.
|
||||
// Also sets the "Filename" key to the relative path of the file.
|
||||
//-----------------------------------------------------------------------------
|
||||
class CASW_KeyValuesDatabase
|
||||
{
|
||||
public:
|
||||
CASW_KeyValuesDatabase();
|
||||
|
||||
int GetFileCount() { return m_Files.Count(); }
|
||||
KeyValues *GetFile( int nFileIndex ) { return m_Files[nFileIndex].m_pKeyValues; }
|
||||
const char* GetFilename( int nFileIndex ) { return m_Files[nFileIndex].m_Filename; }
|
||||
KeyValues* GetFileByName( const char *pFilename );
|
||||
KeyValues *ReloadFile( const char *pFilename );
|
||||
|
||||
// Folder must have a trailing slash
|
||||
void LoadFiles( const char *pFolderName );
|
||||
void AddFile( KeyValues *pKeyValues, const char *pFilename );
|
||||
|
||||
private:
|
||||
void LoadFilesInFolder( const char *pPath );
|
||||
|
||||
static bool m_bLoadedLocalization;
|
||||
|
||||
char m_RootFolder[MAX_PATH];
|
||||
|
||||
struct FileEntry_t
|
||||
{
|
||||
char m_Filename[MAX_PATH];
|
||||
KeyValues* m_pKeyValues;
|
||||
};
|
||||
CUtlVector< FileEntry_t > m_Files;
|
||||
};
|
||||
|
||||
#endif // CASW_KEYVALUESDATABASE_H
|
||||
Reference in New Issue
Block a user