Players are now properly initialized
This commit is contained in:
parent
9f5c310e12
commit
d61be1d967
@ -1,6 +1,5 @@
|
|||||||
package cicaprojekt;
|
package cicaprojekt;
|
||||||
|
|
||||||
import java.io.Console;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
@ -9,6 +8,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class Tester {
|
public class Tester {
|
||||||
private Player oneill;
|
private Player oneill;
|
||||||
@ -18,10 +18,14 @@ public class Tester {
|
|||||||
|
|
||||||
Dungeon loadMap(String param) throws IOException{
|
Dungeon loadMap(String param) throws IOException{
|
||||||
Dungeon dungeon = new Dungeon();
|
Dungeon dungeon = new Dungeon();
|
||||||
dungeon.buildDungeon(new File(param));
|
Map playerLocations = dungeon.buildDungeon(new File(param));
|
||||||
|
oneill = new Player("ONeill", (Tile) playerLocations.get("oneill"), Direction.NORTH);
|
||||||
|
jaffa = new Player("Jaffa", (Tile) playerLocations.get("jaffa"), Direction.NORTH);
|
||||||
return dungeon;
|
return dungeon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void listPlayers() {
|
void listPlayers() {
|
||||||
System.out.println(oneill);
|
System.out.println(oneill);
|
||||||
System.out.println(jaffa);
|
System.out.println(jaffa);
|
||||||
|
Loading…
Reference in New Issue
Block a user