~ares-developers/ares/gd03

« back to all changes in this revision

Viewing changes to Commands/DumpTypes.h

  • Committer: Renegade
  • Date: 2010-05-29 08:12:17 UTC
  • Revision ID: git-v1:0a1bb6321f04d723afe64d1b843dc87b4da783ec
Creating /trunk/src.

git-svn-id: svn://svn.renegadeprojects.com/ares/trunk@622 859b54a9-7a54-0410-aeb3-f8d2f1fa40fd

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef CMD_DUMPTYPES_H
2
 
#define CMD_DUMPTYPES_H
3
 
 
4
 
#include "../Ares.h"
5
 
#include "../Misc/Debug.h"
6
 
 
7
 
class DumperTypesCommandClass : public CommandClass
8
 
{
9
 
public:
10
 
        //Destructor
11
 
        virtual ~DumperTypesCommandClass(){}
12
 
 
13
 
        //CommandClass
14
 
        virtual const char* GetName()
15
 
        { return "Dump Data Types"; }
16
 
 
17
 
        virtual const wchar_t* GetUIName()
18
 
        { return L"Dump Types"; }
19
 
 
20
 
        virtual const wchar_t* GetUICategory()
21
 
                { return L"Development"; }
22
 
 
23
 
        virtual const wchar_t* GetUIDescription()
24
 
                { return L"Dumps the current type list to the log"; }
25
 
 
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()); \
31
 
        }
32
 
 
33
 
        virtual void Execute(DWORD dwUnk)
34
 
        {
35
 
                Debug::Log("Dumping all Types\n\n");
36
 
 
37
 
                Debug::Log("Dumping Rules Types\n\n");
38
 
 
39
 
                LOGTYPE(Anim, Animations);
40
 
                LOGTYPE(Weapon, WeaponTypes);
41
 
                LOGTYPE(Warhead, Warheads);
42
 
                LOGTYPE(Bullet, Projectiles);
43
 
 
44
 
                LOGTYPE(House, Countries);
45
 
 
46
 
                LOGTYPE(Infantry, InfantryTypes);
47
 
                LOGTYPE(Unit, VehicleTypes);
48
 
                LOGTYPE(Aircraft, AircraftTypes);
49
 
                LOGTYPE(Building, BuildingTypes);
50
 
 
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);
57
 
 
58
 
/*
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);
63
 
                }
64
 
*/
65
 
 
66
 
                Debug::Log("Dumping AI Types\n\n");
67
 
                LOGTYPE(Script, ScriptTypes);
68
 
                LOGTYPE(Team, TeamTypes);
69
 
 
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());
74
 
                }
75
 
 
76
 
                Debug::Log("[AITriggerTypes]\n");
77
 
                for(int i = 0; i < AITriggerTypeClass::Array->Count; ++i) {
78
 
                        char Buffer[1024];
79
 
                        memset(Buffer, 0, 1024);
80
 
                        AITriggerTypeClass::Array->GetItem(i)->FormatForSaving(Buffer);
81
 
                        Debug::Log("%s\n", Buffer);
82
 
                }
83
 
 
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");
88
 
                }
89
 
 
90
 
                MessageListClass::PrintMessage(L"Type data dumped");
91
 
        }
92
 
 
93
 
        //Constructor
94
 
        DumperTypesCommandClass(){}
95
 
};
96
 
 
97
 
#endif