[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" |
---|
[6358] | 22 | #include "class_list.h" |
---|
[4347] | 23 | |
---|
[7193] | 24 | #include "util/loading/load_param.h" |
---|
[4940] | 25 | #include "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 | |
---|
[6358] | 32 | using namespace std; |
---|
[4820] | 33 | |
---|
[6409] | 34 | |
---|
[6358] | 35 | //! This creates a Factory to fabricate a SinglePlayerWorld |
---|
[6360] | 36 | CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD); |
---|
[5915] | 37 | |
---|
[5996] | 38 | |
---|
[5205] | 39 | |
---|
[6358] | 40 | SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root) |
---|
[6989] | 41 | : GameWorld() |
---|
[4010] | 42 | { |
---|
[6402] | 43 | this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld"); |
---|
[6374] | 44 | this->setName("SinglePlayerWorld uninitialized"); |
---|
| 45 | |
---|
[6407] | 46 | this->dataTank = new SinglePlayerWorldData(); |
---|
| 47 | |
---|
[4261] | 48 | this->loadParams(root); |
---|
[4010] | 49 | } |
---|
| 50 | |
---|
[6358] | 51 | |
---|
[4555] | 52 | /** |
---|
[6358] | 53 | * remove the SinglePlayerWorld from memory |
---|
[6150] | 54 | * |
---|
| 55 | * delete everything explicitly, that isn't contained in the parenting tree! |
---|
| 56 | * things contained in the tree are deleted automaticaly |
---|
[4838] | 57 | */ |
---|
[6358] | 58 | SinglePlayerWorld::~SinglePlayerWorld () |
---|
[1872] | 59 | { |
---|
[6358] | 60 | PRINTF(3)("SinglePlayerWorld::~SinglePlayerWorld() - deleting current world\n"); |
---|
[7287] | 61 | |
---|
| 62 | if( this->dataTank) |
---|
| 63 | delete this->dataTank; |
---|
[6358] | 64 | } |
---|
[3677] | 65 | |
---|
[5115] | 66 | |
---|
[3526] | 67 | /** |
---|
[6358] | 68 | * loads the parameters of a SinglePlayerWorld from an XML-element |
---|
[4978] | 69 | * @param root the XML-element to load from |
---|
| 70 | */ |
---|
[6358] | 71 | void SinglePlayerWorld::loadParams(const TiXmlElement* root) |
---|
[4261] | 72 | { |
---|
[6512] | 73 | GameWorld::loadParams(root); |
---|
[4261] | 74 | |
---|
[6376] | 75 | PRINTF(4)("Loaded SinglePlayerWorld specific stuff\n"); |
---|
[6358] | 76 | } |
---|
[4834] | 77 | |
---|