Last change
on this file since 3542 was
3533,
checked in by bensch, 20 years ago
|
orxonox/trunk: added some more files to the new destructor-type
|
File size:
1.5 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: Benjamin Grauer |
---|
15 | co-programmer: ... |
---|
16 | */ |
---|
17 | |
---|
18 | |
---|
19 | #include "track_node.h" |
---|
20 | |
---|
21 | #include "null_parent.h" |
---|
22 | |
---|
23 | #include "track_manager.h" |
---|
24 | |
---|
25 | using namespace std; |
---|
26 | |
---|
27 | TrackNode* TrackNode::singletonRef = 0; |
---|
28 | |
---|
29 | TrackNode* TrackNode::getInstance () |
---|
30 | { |
---|
31 | if (!singletonRef) |
---|
32 | singletonRef = new TrackNode (); |
---|
33 | return singletonRef; |
---|
34 | } |
---|
35 | |
---|
36 | /** |
---|
37 | \brief standard constructor |
---|
38 | |
---|
39 | \todo this constructor is not jet implemented - do it |
---|
40 | */ |
---|
41 | TrackNode::TrackNode () |
---|
42 | { |
---|
43 | this->setClassName("TrackNode"); |
---|
44 | singletonRef = this; |
---|
45 | |
---|
46 | NullParent::getInstance()->addChild(this); |
---|
47 | this->trackManager = TrackManager::getInstance(); |
---|
48 | this->mode = ALL; |
---|
49 | } |
---|
50 | |
---|
51 | |
---|
52 | TrackNode::TrackNode (Vector* absCoordinate) |
---|
53 | { |
---|
54 | this->parent = NullParent::getInstance(); |
---|
55 | this->trackManager = TrackManager::getInstance(); |
---|
56 | this->mode = ALL; |
---|
57 | this->absCoordinate = *absCoordinate; |
---|
58 | } |
---|
59 | |
---|
60 | |
---|
61 | /** |
---|
62 | \brief standard deconstructor |
---|
63 | |
---|
64 | \todo this deconstructor is not jet implemented - do it |
---|
65 | */ |
---|
66 | TrackNode::~TrackNode () |
---|
67 | { |
---|
68 | this->destroy(); |
---|
69 | } |
---|
70 | |
---|
71 | /** |
---|
72 | \brief destroys the TrackNode and all its alocated memory. |
---|
73 | */ |
---|
74 | void TrackNode::destroy(void) |
---|
75 | { |
---|
76 | singletonRef = NULL; |
---|
77 | |
---|
78 | static_cast<PNode*>(this)->destroy(); |
---|
79 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.