コード例 #1
0
    def _Update(self, timeElapsed):
        """This will be where we update all of the contained entities. (This happens once per game update!)"""

        #print "gonna update the cSpace."

        Entity._Update(self, timeElapsed)

        #print "done updating the cSpace."
        
        for indx in xrange(len(self._pqEntities)):
            #This will check to see if the current Entity has signaled to be removed.
            if self._pqEntities[indx]._Is_Expired():
                #So we let the entity do its cleaning up, then we remove it from the Entity_List entirely.
                self._pqEntities[indx]._On_Expire()
                self._Remove_Entity(self._pqEntities[indx]._Get_Name())
                #We won't need to update a removed entity!
                break

            #Now since that this entity hasn't been removed, we'll update it.
            self._pqEntities[indx]._Update(timeElapsed)