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
RevLine 
[1853]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.
[1855]12
13   ### File Specific:
14   main-programmer: Patrick Boenzli
15   co-programmer:
[1853]16*/
17
18
19#include "world.h"
20
[1856]21#include <iostream>
[1853]22
[1856]23using namespace std;
[1853]24
25
[1856]26
[1853]27World::World () {
[1855]28  lastPlayer = null;
[1853]29}
30
31
32World::~World () {}
33
34
[1855]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;
[1856]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    }
[1855]55  lastPlayer = listMember;
56}
57
58
59
60/**
61   \brief Routine for testing purposes.
62   
63   testing, testing, testing...
64*/
[1856]65void World::testThaTest() 
[1855]66{
[1856]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    }
[1855]76
[1856]77  cout << "World::testThaTest() finished" << endl;
[1855]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.