Changeset 8700 for code/branches/presentation/src/modules/docking/Dock.cc
- Timestamp:
- Jun 6, 2011, 8:15:38 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/modules/docking/Dock.cc
r8667 r8700 63 63 } 64 64 65 66 65 void Dock::XMLPort(Element& xmlelement, XMLPort::Mode mode) 67 66 { … … 79 78 XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode); 80 79 } 81 82 80 83 81 bool Dock::execute(bool bTriggered, BaseObject* trigger) … … 109 107 { 110 108 // Add player to this Docks candidates 111 candidates .insert(player);109 candidates_.insert(player); 112 110 113 111 // Show docking dialog … … 117 115 { 118 116 // Remove player from candidates list 119 candidates.erase(player); 120 } 121 122 return true; 123 } 124 117 candidates_.erase(player); 118 } 119 120 return true; 121 } 125 122 126 123 void Dock::cmdDock() … … 144 141 } 145 142 146 147 143 bool Dock::dock(PlayerInfo* player) 148 144 { 149 145 // Check if player is a candidate 150 if(candidates .find(player) == candidates.end())146 if(candidates_.find(player) == candidates_.end()) 151 147 { 152 148 COUT(2) << "Dock::dock Player is not a candidate!" << std::endl; … … 154 150 } 155 151 156 candidates .erase(player);157 docked .insert(player);158 159 if (animations .empty())152 candidates_.erase(player); 153 docked_.insert(player); 154 155 if (animations_.empty()) 160 156 return dockingAnimationFinished(player); 161 157 else 162 DockingAnimation::invokeAnimation(true, player, animations );158 DockingAnimation::invokeAnimation(true, player, animations_); 163 159 164 160 return true; … … 167 163 bool Dock::dockingAnimationFinished(PlayerInfo* player) 168 164 { 169 if(docked .find(player) == docked.end())165 if(docked_.find(player) == docked_.end()) 170 166 { 171 167 COUT(2) << "Dock::dockingAnimationFinished Player is not currently docked." << std::endl; … … 173 169 } 174 170 175 DockingEffect::invokeEffect(true, player, effects );171 DockingEffect::invokeEffect(true, player, effects_); 176 172 return true; 177 173 } … … 180 176 { 181 177 // Check if player is docked to this Dock 182 if(docked .find(player) == docked.end())178 if(docked_.find(player) == docked_.end()) 183 179 { 184 180 COUT(2) << "Dock::undock Player is not docked to this Dock." << std::endl; … … 186 182 } 187 183 188 docked .erase(player);189 candidates .insert(player);190 191 DockingEffect::invokeEffect(false, player, effects );192 193 if (animations .empty())184 docked_.erase(player); 185 candidates_.insert(player); 186 187 DockingEffect::invokeEffect(false, player, effects_); 188 189 if (animations_.empty()) 194 190 return undockingAnimationFinished(player); 195 191 else 196 DockingAnimation::invokeAnimation(false, player, animations );192 DockingAnimation::invokeAnimation(false, player, animations_); 197 193 198 194 return true; … … 204 200 } 205 201 206 207 202 unsigned int Dock::getNumberOfActiveDocks() 208 203 { … … 211 206 for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it) 212 207 { 213 if(it->candidates .find(player) != it->candidates.end())208 if(it->candidates_.find(player) != it->candidates_.end()) 214 209 i++; 215 210 } … … 222 217 for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it) 223 218 { 224 if(it->candidates .find(player) != it->candidates.end())219 if(it->candidates_.find(player) != it->candidates_.end()) 225 220 { 226 221 if(index == 0) … … 232 227 } 233 228 234 235 229 bool Dock::addEffect(DockingEffect* effect) 236 230 { 237 231 assert(effect); 238 effects .push_back(effect);232 effects_.push_back(effect); 239 233 return true; 240 234 } … … 242 236 const DockingEffect* Dock::getEffect(unsigned int i) const 243 237 { 244 for (std::list<DockingEffect*>::const_iterator effect = this->effects .begin(); effect != this->effects.end(); ++effect)238 for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect) 245 239 { 246 240 if(i == 0) … … 255 249 assert(animation); 256 250 animation->setParent(this); 257 animations .push_back(animation);251 animations_.push_back(animation); 258 252 return true; 259 253 } … … 261 255 const DockingAnimation* Dock::getAnimation(unsigned int i) const 262 256 { 263 for (std::list<DockingAnimation*>::const_iterator animation = this->animations .begin(); animation != this->animations.end(); ++animation)257 for (std::list<DockingAnimation*>::const_iterator animation = this->animations_.begin(); animation != this->animations_.end(); ++animation) 264 258 { 265 259 if(i == 0) … … 270 264 } 271 265 } 272
Note: See TracChangeset
for help on using the changeset viewer.