1
0
forked from 0ad/0ad
0ad/source/simulation/BaseFormation.h
pyrolink 3408b078b7 #Unit formations and rank textures
-Added functionality for "casting" and creating net messages (without
JS)
-Rank textures-specified in XML
-Formations-currently don't attack correctly (i.e. travel like mobs) and
don't switch to their movement formations when tasked to go somewhere
(the pathfinder doesn't give any heads up about destination reached, so
there's no way to change back to the original).  Also, base switching is
untested so no garuntees for next and prior formation things.

This was SVN commit r3710.
2006-03-31 03:30:34 +00:00

67 lines
1.4 KiB
C++

//Andrew aka pyrolink
//ajdecker1022@msn.com
//This class loads all the formation data needs to create an instance of a particular formation.
#ifndef BASEFORMATION_INCLUDED
#define BASEFORMATION_INCLUDED
#include <vector>
#include <map>
#include "XML/Xeromyces.h"
class CStr;
class CBaseFormation
{
friend class CFormationManager;
friend class CBaseFormationCollection;
friend class CEntityFormation;
struct FormationSlot
{
float fileOff; //Distance between files of this slot and the formation's center
float rankOff;
std::vector<CStr> category;
};
public:
CBaseFormation();
~CBaseFormation(){}
CStr GetBonus(){ return m_bonus; }
CStr GetBonusType(){ return m_bonusType; }
float GetBonusVal(){ return m_bonusVal; }
CStr GetPenalty(){ return m_penalty; }
CStr GetPenaltyType(){ return m_penaltyType; }
float GetPenaltyVal(){ return m_penaltyVal; }
private:
CStr m_tag;
CStr m_bonus;
CStr m_bonusType;
float m_bonusVal;
CStr m_penalty;
CStr m_penaltyType;
float m_penaltyVal;
int m_required;
CStr m_next;
CStr m_prior;
CStr m_movement;
float m_fileSpacing;
float m_rankSpacing;
int m_numSlots; //how many possible slots in this formation
int m_numRanks;
int m_numFiles;
//The key is the "order" of the slot
std::map<int, FormationSlot> m_slots;
bool loadXML(CStr filename);
void AssignCategory(int order, CStr category); //takes care of formatting strings
};
#endif