2023-10-12 12:18:24 -04:00
|
|
|
#include "legoobjectfactory.h"
|
|
|
|
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "carrace.h"
|
2023-10-12 12:18:24 -04:00
|
|
|
#include "decomp.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "dunebuggy.h"
|
|
|
|
#include "elevatorbottom.h"
|
|
|
|
#include "gasstation.h"
|
|
|
|
#include "gasstationstate.h"
|
|
|
|
#include "helicopter.h"
|
|
|
|
#include "helicopterstate.h"
|
|
|
|
#include "historybook.h"
|
|
|
|
#include "hospital.h"
|
|
|
|
#include "hospitalstate.h"
|
|
|
|
#include "infocenter.h"
|
|
|
|
#include "infocenterdoor.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "infocenterstate.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "isle.h"
|
|
|
|
#include "jetskirace.h"
|
|
|
|
#include "lego3dwavepresenter.h"
|
|
|
|
#include "legoact2.h"
|
|
|
|
#include "legoact2state.h"
|
|
|
|
#include "legoactioncontrolpresenter.h"
|
|
|
|
#include "legoactor.h"
|
|
|
|
#include "legoactorpresenter.h"
|
|
|
|
#include "legoanimactor.h"
|
|
|
|
#include "legoanimpresenter.h"
|
|
|
|
#include "legocarbuild.h"
|
|
|
|
#include "legocarbuildanimpresenter.h"
|
|
|
|
#include "legocarraceactor.h"
|
|
|
|
#include "legoentity.h"
|
|
|
|
#include "legoentitypresenter.h"
|
|
|
|
#include "legoflctexturepresenter.h"
|
|
|
|
#include "legohideanimpresenter.h"
|
|
|
|
#include "legojetski.h"
|
|
|
|
#include "legojetskiraceactor.h"
|
|
|
|
#include "legoloadcachesoundpresenter.h"
|
|
|
|
#include "legolocomotionanimpresenter.h"
|
|
|
|
#include "legoloopinganimpresenter.h"
|
|
|
|
#include "legomodelpresenter.h"
|
|
|
|
#include "legopalettepresenter.h"
|
|
|
|
#include "legopartpresenter.h"
|
|
|
|
#include "legopathactor.h"
|
|
|
|
#include "legopathpresenter.h"
|
|
|
|
#include "legophonemepresenter.h"
|
|
|
|
#include "legoracecar.h"
|
|
|
|
#include "legotexturepresenter.h"
|
|
|
|
#include "legoworld.h"
|
|
|
|
#include "legoworldpresenter.h"
|
|
|
|
#include "mxcontrolpresenter.h"
|
|
|
|
#include "mxvideopresenter.h"
|
|
|
|
#include "pizza.h"
|
|
|
|
#include "pizzamissionstate.h"
|
|
|
|
#include "police.h"
|
|
|
|
#include "policestate.h"
|
|
|
|
#include "registrationbook.h"
|
|
|
|
#include "score.h"
|
|
|
|
#include "scorestate.h"
|
|
|
|
#include "skateboard.h"
|
|
|
|
// #include "act2actor.h"
|
|
|
|
#include "act2brick.h"
|
|
|
|
// #include "act2genactor.h"
|
|
|
|
#include "act2policestation.h"
|
|
|
|
#include "act3.h"
|
|
|
|
#include "act3state.h"
|
|
|
|
#include "ambulance.h"
|
|
|
|
#include "ambulancemissionstate.h"
|
|
|
|
#include "bike.h"
|
|
|
|
#include "doors.h"
|
|
|
|
#include "jetski.h"
|
|
|
|
#include "legoanimmmpresenter.h"
|
2024-01-14 17:00:03 -05:00
|
|
|
#include "motocycle.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "racecar.h"
|
|
|
|
#include "towtrack.h"
|
|
|
|
#include "towtrackmissionstate.h"
|
|
|
|
// #include "act3cop.h"
|
|
|
|
// #include "act3brickster.h"
|
|
|
|
#include "act1state.h"
|
|
|
|
#include "act3actor.h"
|
|
|
|
#include "act3shark.h"
|
|
|
|
#include "beachhouseentity.h"
|
|
|
|
#include "bumpbouy.h"
|
|
|
|
#include "carracestate.h"
|
2024-02-10 18:44:00 -05:00
|
|
|
#include "caveentity.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "gasstationentity.h"
|
|
|
|
#include "hospitalentity.h"
|
|
|
|
#include "infocenterentity.h"
|
2024-03-05 16:05:38 -05:00
|
|
|
#include "jailentity.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "jetskiracestate.h"
|
2024-03-05 16:05:38 -05:00
|
|
|
#include "jukebox.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "jukeboxentity.h"
|
2024-03-05 16:05:38 -05:00
|
|
|
#include "jukeboxstate.h"
|
|
|
|
#include "mxcompositemediapresenter.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "pizzeria.h"
|
|
|
|
#include "pizzeriastate.h"
|
|
|
|
#include "policeentity.h"
|
|
|
|
#include "racestandsentity.h"
|
|
|
|
#include "radiostate.h"
|
|
|
|
// #include "raceskel.h"
|
|
|
|
#include "animstate.h"
|
|
|
|
|
|
|
|
// TODO: Before HospitalState, add all of the different LegoVehicleBuildState's
|
2023-10-12 12:18:24 -04:00
|
|
|
|
|
|
|
// TODO: Uncomment once we have all the relevant types ready
|
|
|
|
// DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8);
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10006e40
|
2023-10-12 12:18:24 -04:00
|
|
|
LegoObjectFactory::LegoObjectFactory()
|
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
#define X(V) this->m_id##V = MxAtomId(#V, e_exact);
|
2023-10-24 19:38:27 -04:00
|
|
|
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
|
2023-10-12 12:18:24 -04:00
|
|
|
#undef X
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10009a90
|
2023-10-24 19:38:27 -04:00
|
|
|
MxCore* LegoObjectFactory::Create(const char* p_name)
|
2023-10-12 12:18:24 -04:00
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
MxAtomId atom(p_name, e_exact);
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
#define X(V) \
|
|
|
|
if (this->m_id##V == atom) { \
|
|
|
|
return new V; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
|
2023-10-12 12:18:24 -04:00
|
|
|
#undef X
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
|
|
|
return MxObjectFactory::Create(p_name);
|
|
|
|
}
|
2023-10-12 12:18:24 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1000fb30
|
2023-10-24 19:38:27 -04:00
|
|
|
void LegoObjectFactory::Destroy(MxCore* p_object)
|
2023-10-12 12:18:24 -04:00
|
|
|
{
|
2023-11-05 17:41:35 -05:00
|
|
|
delete p_object;
|
2023-10-12 12:18:24 -04:00
|
|
|
}
|