Skip to content
Snippets Groups Projects
Commit 9e3b5e71 authored by CsellarAndras's avatar CsellarAndras
Browse files

Added again name argument to person constructor

parent aec65472
Branches
No related tags found
No related merge requests found
package arctic_nightmare;
public class Eskimo extends Person {
public Eskimo(Field f, Game g) {
super(f, g);
public Eskimo(String name, Field f, Game g) {
super(name, f, g);
maxTemp = 5;
bodyTemp = 5;
}
public Eskimo(Game g) {
super(g);
public Eskimo(String name, Game g) {
super(name, g);
maxTemp = 5;
bodyTemp = 5;
}
......
......@@ -3,14 +3,14 @@ package arctic_nightmare;
public class Explorer extends Person {
public Explorer(Field f, Game g) {
super(f, g);
public Explorer(String name, Field f, Game g) {
super(name, f, g);
maxTemp = 4;
bodyTemp = 4;
}
public Explorer(Game g) {
super(g);
public Explorer(String name, Game g) {
super(name, g);
maxTemp = 4;
bodyTemp = 4;
}
......
......@@ -81,9 +81,9 @@ public class Game{
for(int i = 0; i < playernum; ++i) {
Person newperson = null;
if(i % 2 == 0)
newperson = new Eskimo(this);
newperson = new Eskimo("Fakename", this);
else
newperson = new Explorer(board.getfield((i + 1) * 2), this);
newperson = new Explorer("Fakename", board.getfield((i + 1) * 2), this);
players.add(newperson);
if(board.getfield((i + 1) * 2).canAddPlayer())
board.getfield((i + 1) * 2).addPlayer(newperson);
......
......@@ -27,10 +27,7 @@ final public class Logger {
try {
fileoutput = new FileOutputStream(file);
} catch (FileNotFoundException ex) {
Log(ex.toString(), false);
} catch (IOException ex) {
Log(ex.toString(), false);
}
Log(ex.toString(), false);}
tabs = 0;
}
......
......@@ -26,9 +26,9 @@ public abstract class Person {
///Person konstruktorba kell Game mindenképpen
public Person(Field f, Game g) {
public Person(String name, Field f, Game g) {
work = 0;
name = new String();
this.name = name;
field = f;
items = new Vector<Item>();
game = g;
......@@ -36,9 +36,9 @@ public abstract class Person {
id = idcounter++;
}
public Person(Game g) {
public Person(String name, Game g) {
work = 0;
name = new String();
this.name = name;
field = null;
items = new Vector<Item>();
game = g;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment