Last change
on this file since 3570 was
3552,
checked in by bensch, 20 years ago
|
orxonox/trunk: added init-function to PNode and chars now get copied and deleted instead of just the reference
|
File size:
976 bytes
|
Rev | Line | |
---|
[3302] | 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 "base_object.h" |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | using namespace std; |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | /** |
---|
| 26 | \brief standard constructor |
---|
| 27 | */ |
---|
[3531] | 28 | BaseObject::BaseObject () |
---|
| 29 | { |
---|
| 30 | this->className = NULL; |
---|
| 31 | } |
---|
[3302] | 32 | |
---|
| 33 | |
---|
| 34 | /** |
---|
| 35 | \brief standard deconstructor |
---|
| 36 | */ |
---|
[3531] | 37 | BaseObject::~BaseObject () |
---|
| 38 | { |
---|
[3552] | 39 | delete []this->className; |
---|
[3531] | 40 | } |
---|
[3302] | 41 | |
---|
| 42 | void BaseObject::setClassName (char* className) |
---|
| 43 | { |
---|
[3552] | 44 | this->className = new char[strlen(className)+1]; |
---|
| 45 | strcpy(this->className, className); |
---|
[3302] | 46 | } |
---|
| 47 | |
---|
[3442] | 48 | char* BaseObject::getClassName(void) const |
---|
| 49 | { |
---|
| 50 | return className; |
---|
| 51 | } |
---|
[3302] | 52 | |
---|
| 53 | bool BaseObject::isA (char* className) |
---|
| 54 | { |
---|
| 55 | if( this->className == className) |
---|
| 56 | return false; |
---|
| 57 | return true; |
---|
| 58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.