Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/story_entities/single_player_world.cc @ 6374

Last change on this file since 6374 was 6374, checked in by patrick, 18 years ago

network: single player loads again, many changes in the function bodies of the loading code

File size: 2.1 KB
Line 
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 "single_player_world.h"
18
19#include "state.h"
20#include "class_list.h"
21
22#include "load_param.h"
23#include "fast_factory.h"
24#include "factory.h"
25
26#include "world_entity.h"
27#include "npcs/npc_test1.h"
28
29
30using namespace std;
31
32//! This creates a Factory to fabricate a SinglePlayerWorld
33CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
34
35
36
37SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root)
38  : GameWorld(root)
39{
40  this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerSinglePlayerWorld");
41  this->setName("SinglePlayerWorld uninitialized");
42
43  this->loadParams(root);
44}
45
46
47/**
48 *  remove the SinglePlayerWorld from memory
49 *
50 *  delete everything explicitly, that isn't contained in the parenting tree!
51 *  things contained in the tree are deleted automaticaly
52 */
53SinglePlayerWorld::~SinglePlayerWorld ()
54{
55  PRINTF(3)("SinglePlayerWorld::~SinglePlayerWorld() - deleting current world\n");
56}
57
58
59/**
60 * loads the parameters of a SinglePlayerWorld from an XML-element
61 * @param root the XML-element to load from
62 */
63void SinglePlayerWorld::loadParams(const TiXmlElement* root)
64{
65  static_cast<GameWorld*>(this)->loadParams(root);
66
67  PRINTF(4)("Creating a SinglePlayerWorld\n");
68}
69
70
71
72
73// ErrorMessage SinglePlayerWorld::load()
74// {
75//   static_cast<GameWorld*>(this)->load();
76//
77//   /* the the single player specific stuff here */
78//
79//   /* some static world entities */
80//   for(int i = 0; i < 100; i++)
81//   {
82//     WorldEntity* tmp = new NPCTest1();
83//     char npcChar[10];
84//     sprintf (npcChar, "NPC_%d", i);
85//     tmp->setName(npcChar);
86//     tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
87//     this->spawn(tmp);
88//   }
89// }
90
Note: See TracBrowser for help on using the repository browser.