I tried iterating with a normal for-Loop and for each, but it does not verify.
package com.codegym.task.task21.task2113;
import java.util.*;
public class Hippodrome {
private List<Horse> horses = new ArrayList<>();
public static Hippodrome game;
public void run() throws InterruptedException {
for (int i = 0; i<100; i++){
Thread.sleep(200);
move();
print();
}
}
public void move(){
for (Horse horse : horses){
horse.move();
}
}
public void print(){}
public Hippodrome() {
}
public List<Horse> getHorses(){
return horses;
}
public Hippodrome(List<Horse> horses){
this.horses = horses;
}
public static void main (String[] args){
game = new Hippodrome();
game.horses = new ArrayList<>();
game.horses.add(new Horse("Michael", 3, 0));
game.horses.add(new Horse("Lulu", 3, 0));
game.horses.add(new Horse("Hasi", 3, 0));
}
}