/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program 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, or (at your option) any later version. ### File Specific: main-programmer: Patrick Boenzli */ #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD #include "multi_player_world.h" #include "state.h" #include "class_list.h" #include "load_param.h" #include "fast_factory.h" #include "factory.h" using namespace std; //! This creates a Factory to fabricate a MultiPlayerWorld CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD); MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root) : GameWorld(root) { this->constuctorInit("", -1); this->path = NULL; this->loadParams(root); } /** * remove the MultiPlayerWorld from memory * * delete everything explicitly, that isn't contained in the parenting tree! * things contained in the tree are deleted automaticaly */ MultiPlayerWorld::~MultiPlayerWorld () { PRINTF(3)("MultiPlayerWorld::~MultiPlayerWorld() - deleting current world\n"); } /** * initializes the world. * @param name the name of the world * @param worldID the ID of this world * * set all stuff here that is world generic and does not use to much memory * because the real init() function StoryEntity::init() will be called * shortly before start of the game. * since all worlds are initiated/referenced before they will be started. * NO LEVEL LOADING HERE - NEVER! */ void MultiPlayerWorld::constuctorInit(const char* name, int worldID) { this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld"); this->setName(name); this->gameTime = 0.0f; this->setSpeed(1.0); this->music = NULL; this->shell = NULL; this->localPlayer = NULL; this->localCamera = NULL; this->showPNodes = false; this->showBV = false; } /** * loads the parameters of a MultiPlayerWorld from an XML-element * @param root the XML-element to load from */ void MultiPlayerWorld::loadParams(const TiXmlElement* root) { static_cast(this)->loadParams(root); PRINTF(4)("Creating a MultiPlayerWorld\n"); } /** * this is executed just before load * * since the load function sometimes needs data, that has been initialized * before the load and after the proceeding storyentity has finished */ ErrorMessage MultiPlayerWorld::preLoad() { static_cast(this)->preLoad(); /* the the single player specific stuff */ } /** * loads the MultiPlayerWorld by initializing all resources, and set their default values. */ ErrorMessage MultiPlayerWorld::load() { static_cast(this)->load(); /* the the single player specific stuff here */ } /** * post loads the MultiPlayerWorld by initializing all resources, and set their default values. */ ErrorMessage MultiPlayerWorld::postLoad() { static_cast(this)->postLoad(); /* the single player specific stuff here */ }