Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/core/world.cc @ 1856

Last change on this file since 1856 was 1856, checked in by patrick, 20 years ago

orxonox/trunk/core: test routines added, other minor changes

File size: 1.6 KB
Line 
1
2
3/*
4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific:
14   main-programmer: Patrick Boenzli
15   co-programmer:
16*/
17
18
19#include "world.h"
20
21#include <iostream>
22
23using namespace std;
24
25
26
27World::World () {
28  lastPlayer = null;
29}
30
31
32World::~World () {}
33
34
35/**
36   \brief Add Player
37   \param player A reference to the new player object
38   
39   Add a new Player to the game. Player has to be initialised previously
40*/
41bool World::addPlayer(Player* player) 
42{
43  playerList* listMember = new playerList;
44  listMember->player = player;
45  if ( lastPlayer != null ) 
46    {
47      listMember->number = lastPlayer->number + 1;
48      listMember->next = lastPlayer;
49    }
50  else 
51    {
52      listMember->number = 0;
53      listMember->next = null;
54    }
55  lastPlayer = listMember;
56}
57
58
59
60/**
61   \brief Routine for testing purposes.
62   
63   testing, testing, testing...
64*/
65void World::testThaTest() 
66{
67  cout << "World::testThaTest() called" << endl;
68  /* test addPlayer */
69  cout << "addPlayer test..." << endl;
70  playerList* pl = lastPlayer;
71  while ( pl != null )
72    {
73      cout << "player " << pl->number << " was found" << endl;
74      pl = pl->next;
75    }
76
77  cout << "World::testThaTest() finished" << endl;
78}
79
80bool World::removePlayer(Player* player) {}
81
82bool World::addNPC(NPC* npc) {}
83bool World::removeNPC(NPC* npc) {}
Note: See TracBrowser for help on using the repository browser.