Commit 84a3ff34 authored by niklas.mueller01's avatar niklas.mueller01
Browse files

Renamed class, extended initialization of players

parent 3a531eb8
......@@ -10,17 +10,17 @@ import towerwarspp.preset.ArgumentParserException;
* @version 0.1 20th June 2017
* @author Niklas Mueller
*/
public class ageoftowers {
public class AgeOfTowers {
/**
* Constructor to initialize a new game
* @param args list with settings to put into the ArgumentParser
*/
public ageoftowers(String[] args) {
public AgeOfTowers(String[] args) {
try {
ArgumentParser ap = new ArgumentParser(args);
System.out.println("local: " + ap.isLocal());
//System.out.println("local: " + ap.isLocal()); //will probably be removed
System.out.println("network: " + ap.isNetwork());
System.out.println("size: " + ap.getSize());
......@@ -30,13 +30,54 @@ public class ageoftowers {
switch (ap.getRed()) {
case HUMAN:
System.out.println("Red chose human player");
/*
<HumanPlayer> red = new <HumanPlayer>();
*/
break;
case RANDOM_AI:
System.out.println("Red chose random player");
/*
<AIPlayer> red = new <AIPlayer>();
*/
break;
case SIMPLE_AI:
System.out.println("Red chose simple player");
/*
<SimplePlayer red = new <SimplePlayer>();
*/
break;
case ADVANCED_AI_1:
System.out.println("Red chose advanced player");
/*
<AdvancedPlayer> red = new <AdvancedPlayer>();
*/
}
//switch (ap.getBlue()) {}
switch (ap.getBlue()) {
case HUMAN:
System.out.println("Blue chose human player");
/*
<HumanPlayer> blue = new <HumanPlayer>();
*/
break;
case RANDOM_AI:
System.out.println("Blue chose random player");
/*
<AIPlayer> blue = new <AIPlayer>();
*/
break;
case SIMPLE_AI:
System.out.println("Blue chose simple player");
/*
<SimplePlayer blue = new <SimplePlayer>();
*/
break;
case ADVANCED_AI_1:
System.out.println("Blue chose advanced player");
/*
<AdvancedPlayer> blue = new <AdvancedPlayer>();
*/
}
//
}
......@@ -44,7 +85,15 @@ public class ageoftowers {
e.printStackTrace();
}
/*initialize two player-objects with given settings from interface towerwarspp.preset.Player;
red.init(ap.getSize(), PlayerColor.RED);
blue.init(ap.getSize(), PlayerColor.BLUE);
/*initialize board object with given size */
/*
initialize two player-objects with given settings from interface towerwarspp.preset.Player;
both players are using the same object from a class implementing Requestable-Interface
request alternately moves from both players, check validity and inform other player
......@@ -61,7 +110,7 @@ public class ageoftowers {
}
public static void main(String[] args) {
ageoftowers game = new ageoftowers(args);
AgeOfTowers game = new AgeOfTowers(args);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment