1 | /* |
---|
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. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Patrick Boenzli |
---|
13 | */ |
---|
14 | |
---|
15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD |
---|
16 | |
---|
17 | #include "multi_player_world.h" |
---|
18 | #include "multi_player_world_data.h" |
---|
19 | |
---|
20 | #include "factory.h" |
---|
21 | #include "load_param.h" |
---|
22 | |
---|
23 | |
---|
24 | using namespace std; |
---|
25 | |
---|
26 | |
---|
27 | //! This creates a Factory to fabricate a MultiPlayerWorld |
---|
28 | CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD); |
---|
29 | |
---|
30 | |
---|
31 | MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root) |
---|
32 | : GameWorld(root) |
---|
33 | { |
---|
34 | this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld"); |
---|
35 | |
---|
36 | this->multiPlayerWorldData = new MultiPlayerWorldData(); |
---|
37 | this->loadParams(root); |
---|
38 | } |
---|
39 | |
---|
40 | |
---|
41 | /** |
---|
42 | * remove the MultiPlayerWorld from memory |
---|
43 | * |
---|
44 | * delete everything explicitly, that isn't contained in the parenting tree! |
---|
45 | * things contained in the tree are deleted automaticaly |
---|
46 | */ |
---|
47 | MultiPlayerWorld::~MultiPlayerWorld () |
---|
48 | { |
---|
49 | PRINTF(3)("MultiPlayerWorld::~MultiPlayerWorld() - deleting current world\n"); |
---|
50 | if( this->multiPlayerWorldData) |
---|
51 | delete this->multiPlayerWorldData; |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | /** |
---|
56 | * loads the parameters of a MultiPlayerWorld from an XML-element |
---|
57 | * @param root the XML-element to load from |
---|
58 | */ |
---|
59 | void MultiPlayerWorld::loadParams(const TiXmlElement* root) |
---|
60 | { |
---|
61 | static_cast<GameWorld*>(this)->loadParams(root); |
---|
62 | |
---|
63 | PRINTF(4)("Creating a MultiPlayerWorld\n"); |
---|
64 | } |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | |
---|