Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.cc @ 12180

Last change on this file since 12180 was 12180, checked in by merholzl, 5 years ago

World Map merging

File size: 2.0 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Joel Lingg
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#include "SMCoord.h"
30
31namespace orxonox {
32  SMCoord::SMCoord() {
33    set(0);
34  }
35
36  SMCoord::~SMCoord() {
37
38  }
39
40  SMCoord::SMCoord(int x) {
41    set(x);
42  }
43
44  //sets the index. the boundaries neeed to set higher when you want more games.
45  void SMCoord::set(int index) {
46    if (index < 0) {
47      this -> index = 0;
48    } else if (index > 3) {
49      this -> index = 3;
50    } else {
51      this -> index = index;
52    }
53  }
54  //Returns the 3dcoordinate of the symbol which is choosen at the moment
55  Vector3 SMCoord::get3dcoordinate() {
56    Vector3 coord;
57    switch (this -> index) {
58    case 0:
59      coord.x = 550;
60      coord.y = 300;
61      coord.z = 0;
62      break;
63    case 1:
64      coord.x = 600;
65      coord.y = 300;
66      coord.z = 0;
67      break;
68    case 2:
69      coord.x = 650;
70      coord.y = 300;
71      coord.z = 0;
72      break;
73    case 3:
74      coord.x = 700;
75      coord.y = 300;
76      coord.z = 0;
77      break;
78
79    default:
80      coord.x = 550;
81      coord.y = 300;
82      coord.z = 0;
83      break;
84    }
85    return coord;
86  }
87
88  int SMCoord::getIndex() {
89    return this -> index;
90  }
91}
Note: See TracBrowser for help on using the repository browser.