/**
* Called by m_thread.start(). Loops through all players calling PlayerChar.move() if the player requested to be moved.
*/
public void run() {
Char tmp = null;
//ArrayList<Char> tmpArray = null;
while(m_isRunning) {
/* Pull char of highest priority */
if(m_waiting != null && m_waiting.size() > 0) {
synchronized(m_waiting) {
tmp = m_waiting.poll();
}
/* Move character */
tmp.move();
/* Place him in moved array */
synchronized(m_moved) {
m_moved.offer(tmp);
}
}