[Orxonox-commit 4955] r9624 - code/branches/formationupdate/src/orxonox/worldentities/pawns

maxima at orxonox.net maxima at orxonox.net
Tue May 14 15:42:22 CEST 2013


Author: maxima
Date: 2013-05-14 15:42:22 +0200 (Tue, 14 May 2013)
New Revision: 9624

Modified:
   code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
Log:


Modified: code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc	2013-05-14 13:26:33 UTC (rev 9623)
+++ code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc	2013-05-14 13:42:22 UTC (rev 9624)
@@ -308,33 +308,6 @@
     }
 
 
-    // A function to check if this pawn's controller is the master of any formationcontroller
-    bool Pawn::hasSlaves()
-    {
-    	for (ObjectList<FormationController>::iterator it =
-			 ObjectList<FormationController>::begin();
-			 it != ObjectList<FormationController>::end(); ++it )
-		{
-			// checks if the pawn's controller has a slave
-			if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
-				return true;
-		}
-		return false;
-    }
-
-    // A function that returns a slave of the pawn's controller
-    Controller* Pawn::getSlave(){
-    	for (ObjectList<FormationController>::iterator it =
-    			ObjectList<FormationController>::begin();
-    			it != ObjectList<FormationController>::end(); ++it )
-    	{
-    		if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
-    			return it->getController();
-    	}
-    	return 0;
-    }
-
-
     void Pawn::death()
     {
         this->setHealth(1);
@@ -348,7 +321,6 @@
             if (this->getGametype())
                 this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
 
-
             if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
             {
             	// Start to control a new entity if you're the master of a formation
@@ -526,4 +498,33 @@
         this->RadarViewable::settingsChanged();
     }
 
+
+    // A function to check if this pawn's controller is the master of any formationcontroller
+    bool Pawn::hasSlaves()
+    {
+    	for (ObjectList<FormationController>::iterator it =
+			 ObjectList<FormationController>::begin();
+			 it != ObjectList<FormationController>::end(); ++it )
+		{
+			// checks if the pawn's controller has a slave
+			if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
+				return true;
+		}
+		return false;
+    }
+
+    // A function that returns a slave of the pawn's controller
+    Controller* Pawn::getSlave(){
+    	for (ObjectList<FormationController>::iterator it =
+    			ObjectList<FormationController>::begin();
+    			it != ObjectList<FormationController>::end(); ++it )
+    	{
+    		if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
+    			return it->getController();
+    	}
+    	return 0;
+    }
+
+
+
 }




More information about the Orxonox-commit mailing list