2009-04-18 19:00:33 +02:00
|
|
|
/* Copyright (C) 2009 Wildfire Games.
|
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2006-06-10 01:07:11 +02:00
|
|
|
//FormationCollection.h
|
2006-04-24 01:14:18 +02:00
|
|
|
|
2006-07-13 05:29:33 +02:00
|
|
|
//Nearly identical to EntityTemplateCollection and associates i.e. EntityTemplate, Entity.
|
2006-04-24 01:14:18 +02:00
|
|
|
//This is the manager of the entity formation "templates"
|
|
|
|
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_FORMATIONCOLLECTION
|
|
|
|
#define INCLUDED_FORMATIONCOLLECTION
|
2006-04-24 01:14:18 +02:00
|
|
|
|
|
|
|
#include <vector>
|
2009-11-03 22:46:35 +01:00
|
|
|
#include "lib/file/vfs/vfs_path.h"
|
2006-06-02 04:10:27 +02:00
|
|
|
#include "ps/CStr.h"
|
|
|
|
#include "ps/Singleton.h"
|
2007-12-20 21:21:45 +01:00
|
|
|
#include "ps/Filesystem.h"
|
2006-06-10 01:07:11 +02:00
|
|
|
#include "Formation.h"
|
2006-04-24 01:14:18 +02:00
|
|
|
|
2006-06-10 01:07:11 +02:00
|
|
|
#define g_EntityFormationCollection CFormationCollection::GetSingleton()
|
2006-04-24 01:14:18 +02:00
|
|
|
|
|
|
|
|
2006-06-10 01:07:11 +02:00
|
|
|
class CFormationCollection : public Singleton<CFormationCollection>
|
2006-04-24 01:14:18 +02:00
|
|
|
{
|
|
|
|
|
2006-06-10 01:07:11 +02:00
|
|
|
typedef std::map<CStrW, CFormation*> templateMap;
|
2009-11-03 22:46:35 +01:00
|
|
|
typedef std::map<CStrW, VfsPath> templateFilenameMap;
|
2006-04-24 01:14:18 +02:00
|
|
|
templateMap m_templates;
|
|
|
|
templateFilenameMap m_templateFilenames;
|
|
|
|
public:
|
2006-06-10 01:07:11 +02:00
|
|
|
~CFormationCollection();
|
2007-05-02 14:07:08 +02:00
|
|
|
CFormation* GetTemplate( const CStrW& formationType );
|
|
|
|
int LoadTemplates();
|
2007-12-20 21:21:45 +01:00
|
|
|
void LoadFile( const VfsPath& path );
|
2006-04-24 01:14:18 +02:00
|
|
|
|
|
|
|
// Create a list of the names of all base entities, excluding template_*,
|
|
|
|
// for display in ScEd's entity-selection box.
|
2007-05-02 14:07:08 +02:00
|
|
|
void GetFormationNames( std::vector<CStrW>& names );
|
2006-04-24 01:14:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|