diff --git a/bots/Java/BotAPI.jar b/bots/Java/BotAPI.jar new file mode 100644 index 0000000..bd5e413 Binary files /dev/null and b/bots/Java/BotAPI.jar differ diff --git a/bots/Java/src/Bot.java b/bots/Java/src/Bot.java new file mode 100644 index 0000000..1c39dc9 --- /dev/null +++ b/bots/Java/src/Bot.java @@ -0,0 +1,129 @@ +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; + +import javax.swing.*; +import java.util.ArrayList; +import java.util.Objects; + +/** + * Created by Aakash and Sourav on 2/19/2017. + */ + +/**Disclaimer* this library doesn't have the feature to edit fields of a JSON directly + so, it was a pain in the ass to make all the functions that required editing */ +public class Bot { + JSONObject gameState; + String name; + JSONArray moveObject = new JSONArray(); + Bot(JSONObject json, String s) { + gameState = json; + name = s; + JSONArray bots= (JSONArray) gameState.get("bots"); + + + for(int i=0; i getChildren(){ + ArrayList returnArray = new ArrayList<>(); + JSONArray object = (JSONArray) gameState.get("bots"); + for(int i=0; i getBots(){ + ArrayList returnArray = new ArrayList<>(); + JSONArray object = (JSONArray) gameState.get("bots"); + for(int i=0; i