[4555] | 1 | /* |
---|
[1853] | 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
[1855] | 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Patrick Boenzli |
---|
[1853] | 13 | */ |
---|
| 14 | |
---|
[3590] | 15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD |
---|
| 16 | |
---|
[6409] | 17 | |
---|
[6358] | 18 | #include "single_player_world.h" |
---|
[6404] | 19 | #include "single_player_world_data.h" |
---|
[3608] | 20 | |
---|
[4347] | 21 | #include "state.h" |
---|
[9869] | 22 | #include "debug.h" |
---|
[4347] | 23 | |
---|
[7193] | 24 | #include "util/loading/load_param.h" |
---|
[9869] | 25 | #include "loading/fast_factory.h" |
---|
[7193] | 26 | #include "util/loading/factory.h" |
---|
[4245] | 27 | |
---|
[6360] | 28 | #include "world_entity.h" |
---|
| 29 | #include "npcs/npc_test1.h" |
---|
[4504] | 30 | |
---|
[4747] | 31 | |
---|
[10114] | 32 | |
---|
[6358] | 33 | //! This creates a Factory to fabricate a SinglePlayerWorld |
---|
[10114] | 34 | ObjectListDefinition(SinglePlayerWorld); |
---|
[9869] | 35 | CREATE_FACTORY(SinglePlayerWorld); |
---|
[5915] | 36 | |
---|
[6358] | 37 | SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root) |
---|
[6989] | 38 | : GameWorld() |
---|
[4010] | 39 | { |
---|
[9869] | 40 | this->registerObject(this, SinglePlayerWorld::_objectList); |
---|
[6374] | 41 | this->setName("SinglePlayerWorld uninitialized"); |
---|
| 42 | |
---|
[6407] | 43 | this->dataTank = new SinglePlayerWorldData(); |
---|
| 44 | |
---|
[4261] | 45 | this->loadParams(root); |
---|
[4010] | 46 | } |
---|
| 47 | |
---|
[6358] | 48 | |
---|
[4555] | 49 | /** |
---|
[6358] | 50 | * remove the SinglePlayerWorld from memory |
---|
[6150] | 51 | * |
---|
| 52 | * delete everything explicitly, that isn't contained in the parenting tree! |
---|
| 53 | * things contained in the tree are deleted automaticaly |
---|
[4838] | 54 | */ |
---|
[6358] | 55 | SinglePlayerWorld::~SinglePlayerWorld () |
---|
[1872] | 56 | { |
---|
[6358] | 57 | PRINTF(3)("SinglePlayerWorld::~SinglePlayerWorld() - deleting current world\n"); |
---|
[7287] | 58 | |
---|
| 59 | if( this->dataTank) |
---|
| 60 | delete this->dataTank; |
---|
[6358] | 61 | } |
---|
[3677] | 62 | |
---|
[5115] | 63 | |
---|
[3526] | 64 | /** |
---|
[6358] | 65 | * loads the parameters of a SinglePlayerWorld from an XML-element |
---|
[4978] | 66 | * @param root the XML-element to load from |
---|
| 67 | */ |
---|
[6358] | 68 | void SinglePlayerWorld::loadParams(const TiXmlElement* root) |
---|
[4261] | 69 | { |
---|
[6512] | 70 | GameWorld::loadParams(root); |
---|
[4261] | 71 | |
---|
[6376] | 72 | PRINTF(4)("Loaded SinglePlayerWorld specific stuff\n"); |
---|
[6358] | 73 | } |
---|
[4834] | 74 | |
---|