Rev | Line | |
---|
[12151] | 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 | |
---|
[12106] | 29 | #include "SMCoord.h" |
---|
| 30 | |
---|
| 31 | namespace orxonox { |
---|
[12151] | 32 | SMCoord::SMCoord() { |
---|
| 33 | set(0); |
---|
| 34 | } |
---|
[12106] | 35 | |
---|
[12151] | 36 | SMCoord::~SMCoord() { |
---|
[12110] | 37 | |
---|
[12151] | 38 | } |
---|
[12106] | 39 | |
---|
[12151] | 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; |
---|
[12106] | 52 | } |
---|
[12151] | 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; |
---|
[12106] | 78 | |
---|
[12151] | 79 | default: |
---|
| 80 | coord.x = 550; |
---|
| 81 | coord.y = 300; |
---|
| 82 | coord.z = 0; |
---|
| 83 | break; |
---|
[12110] | 84 | } |
---|
[12151] | 85 | return coord; |
---|
| 86 | } |
---|
[12110] | 87 | |
---|
[12151] | 88 | int SMCoord::getIndex() { |
---|
| 89 | return this -> index; |
---|
| 90 | } |
---|
[12106] | 91 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.