Package populus :: Module SocialPlace :: Class Queue
[frames] | no frames]

Class Queue


A Queue instance is constructed when an avatar tries to use a Prop that has 'Queue' as a Function attribute. It stores common knowledge about the queue that is forming before that Prop, such as ordered references to the avatars queuing, the queue target, the participant currently being served and the general queue direction.

Instance Methods
 
__init__(self, target, initiator, manager, parent=render)
 
contains(self, avatar)
Returns True if the avatar is contained in the queue or in a QueuingGroup in the queue.
 
getIndex(self, avatar)
Returns the index of the avatar in the queue (0 is first in line, right after the one being served) or the index of the QueuingGroup which contains the avatar.
 
firstPosition(self, avatar)
Returns True if the avatar or the avatar's QueuingGroup is first in line (right after the one being served).
 
beingServed(self, avatar)
Returns True if the avatar or the avatar's QueuingGroup is currently being served.
 
enqueue(self, avatar)
Adds the avatar or the QueuingGroup to the queue participants (at the end) and calls joinQueue() on it.
 
finishServing(self, task)
Causes the avatar being served to leave and advances the queue.
 
removeQueue(self)
Method Details

finishServing(self, task)

 

Causes the avatar being served to leave and advances the queue. Former first in line will be served, former second in line will be first in line etc. If no participants are left, the queue is destroyed.