Why I have a mistake on the line
game = new Hippodrome();
package com.javarush.task.task21.task2113;
import java.util.Arrays;
import java.util.List;
public class Hippodrome {
public static void main(String[] args) throws InterruptedException {
game = new Hippodrome();
game.getHorses().add(new Horse("Belka", 3, 0));
game.getHorses().add(new Horse("Strelka", 3, 0));
game.getHorses().add(new Horse("Burka", 3, 0));
game.run();
}
private List<Horse> horses;
public static Hippodrome game;
public Hippodrome(List<Horse> horses) {
this.horses = horses;
}
public List<Horse> getHorses() {
return horses;
}
public void run() throws InterruptedException {
for (int i = 0; i < 100; i++) {
move();
print();
Thread.sleep(200);
}
}
public void move() {
for (Horse horse : getHorses()) {
horse.move();
}
}
public void print() {
for (Horse horse : getHorses()) {
horse.print();
}
for (int i = 0; i < 10; i++) {
System.out.println();
}
}
}