Skip to content

Commit 8a5ca6b

Browse files
author
Julien
committed
fix(sdk): make new command line agents retrocompatible
1 parent d66c552 commit 8a5ca6b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

runner/src/main/java/com/codingame/gameengine/runner/CommandLinePlayerAgent.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ public class CommandLinePlayerAgent extends Agent {
2020
* Creates an Agent for your game, will run the given commandLine at game start
2121
*
2222
* @param commandLine
23-
* the commandLine to run
23+
* the command line to run
2424
*/
2525
public CommandLinePlayerAgent(String commandLine) {
2626
super();
27-
this.commandArray = new String[] {commandLine};
27+
this.commandArray = commandLine.split(" ");
2828
}
29-
29+
30+
/**
31+
* Creates an Agent for your game, will run the given commandLine at game start
32+
*
33+
* @param commandArray
34+
* the command array to run
35+
*/
3036
public CommandLinePlayerAgent(String[] commandArray) {
3137
super();
3238
this.commandArray = commandArray;

0 commit comments

Comments
 (0)