package ru.beykerykt.bullsandcows.base.runnables;

import java.util.Iterator;

import ru.beykerykt.bullsandcows.base.BattleArena;
import ru.beykerykt.bullsandcows.base.players.BasePlayer;

public class PlayerRunnable extends BattleArenaRunnable {

	public PlayerRunnable(BattleArena arena) {
		super("players", arena);
	}

	@Override
	public void run() {
		if (!getArena().isPaused()) {
			Iterator<BasePlayer> it = getArena().getPlayers().iterator();
			BasePlayer player = it.next();
			while (it.hasNext()) {
				player.next(it.next());
			}
			player.next(getArena().getPlayers().get(0));
		}
	}
}
@@ -61,16 +61,20 @@
 va.util.
+List
 Iterator
@@ -387,16 +387,20 @@
 )) %7B%0A%09%09%09
+List
 Iterator
@@ -412,18 +412,18 @@
 Player%3E 
+l
 i
-t
  = getAr
@@ -441,17 +441,21 @@
 ayers().
-i
+listI
 terator(
@@ -457,16 +457,41 @@
 ator();%0A
+%09%09%09while(li.hasNext())%7B%0A%09
 %09%09%09BaseP
@@ -505,18 +505,18 @@
 layer = 
+l
 i
-t
 .next();
@@ -523,17 +523,14 @@
 %0A%09%09%09
-while (it
+%09if(li
 .has
@@ -536,19 +536,19 @@
 sNext())
- 
 %7B%0A
+%09
 %09%09%09%09play
@@ -559,10 +559,10 @@
 ext(
+l
 i
-t
 .nex
@@ -570,18 +570,46 @@
 ());%0A%09%09%09
-%7D%0A
+%09%09li.previous();%0A%09%09%09%09%7Delse%7B%0A%09%09
 %09%09%09playe
@@ -648,16 +648,27 @@
 et(0));%0A
+%09%09%09%09%7D%0A%09%09%09%7D%0A
 %09%09%7D%0A%09%7D%0A%7D

implement PlayerRunnable