1
#ifndef CMD_DUMPTYPES_H
2
#define CMD_DUMPTYPES_H
5
#include "../Misc/Debug.h"
7
class DumperTypesCommandClass : public CommandClass
11
virtual ~DumperTypesCommandClass(){}
14
virtual const char* GetName()
15
{ return "Dump Data Types"; }
17
virtual const wchar_t* GetUIName()
18
{ return L"Dump Types"; }
20
virtual const wchar_t* GetUICategory()
21
{ return L"Development"; }
23
virtual const wchar_t* GetUIDescription()
24
{ return L"Dumps the current type list to the log"; }
26
#define LOGTYPE(typestr, section) \
27
Debug::Log("[" # section "]\n"); \
28
for(int i = 0; i < typestr ## TypeClass::Array->Count; ++i) { \
29
typestr ## TypeClass *X = typestr ## TypeClass::Array->GetItem(i); \
30
Debug::Log("%d = %s\n", i, X->get_ID()); \
33
virtual void Execute(DWORD dwUnk)
35
Debug::Log("Dumping all Types\n\n");
37
Debug::Log("Dumping Rules Types\n\n");
39
LOGTYPE(Anim, Animations);
40
LOGTYPE(Weapon, WeaponTypes);
41
LOGTYPE(Warhead, Warheads);
42
LOGTYPE(Bullet, Projectiles);
44
LOGTYPE(House, Countries);
46
LOGTYPE(Infantry, InfantryTypes);
47
LOGTYPE(Unit, VehicleTypes);
48
LOGTYPE(Aircraft, AircraftTypes);
49
LOGTYPE(Building, BuildingTypes);
51
LOGTYPE(SuperWeapon, SuperWeaponTypes);
52
LOGTYPE(Smudge, SmudgeTypes);
53
LOGTYPE(Overlay, OverlayTypes);
54
// LOGTYPE(Terrain, TerrainTypes); // needs class map in YRPP
55
LOGTYPE(Particle, Particles);
56
LOGTYPE(ParticleSystem, ParticleSystems);
59
Debug::Log("Dumping Art Types\n\n");
60
Debug::Log("[Movies]\n");
61
for(int i = 0; i < MovieInfo::Array->Count; ++i) {
62
Debug::Log("%d = %s\n", i, MovieInfo::Array->GetItem(i).Name);
66
Debug::Log("Dumping AI Types\n\n");
67
LOGTYPE(Script, ScriptTypes);
68
LOGTYPE(Team, TeamTypes);
70
Debug::Log("[TaskForces]\n");
71
for(int i = 0; i < TaskForceClass::Array->Count; ++i) {
72
TaskForceClass *X = TaskForceClass::Array->GetItem(i);
73
Debug::Log("%d = %s\n", i, X->get_ID());
76
Debug::Log("[AITriggerTypes]\n");
77
for(int i = 0; i < AITriggerTypeClass::Array->Count; ++i) {
79
memset(Buffer, 0, 1024);
80
AITriggerTypeClass::Array->GetItem(i)->FormatForSaving(Buffer);
81
Debug::Log("%s\n", Buffer);
84
Debug::Log("[AITriggerTypesEnable]\n");
85
for(int i = 0; i < AITriggerTypeClass::Array->Count; ++i) {
86
AITriggerTypeClass *X = AITriggerTypeClass::Array->GetItem(i);
87
Debug::Log("%X = %s\n", X->get_ID(), X->IsEnabled ? "yes" : "no");
90
MessageListClass::PrintMessage(L"Type data dumped");
94
DumperTypesCommandClass(){}