{"id":16903015,"url":"https://github.com/aybabtme/bombjava","last_synced_at":"2025-03-20T14:43:07.389Z","repository":{"id":15128761,"uuid":"17855862","full_name":"aybabtme/bombjava","owner":"aybabtme","description":"Java TCP client for bomberman,","archived":false,"fork":false,"pushed_at":"2014-03-30T18:09:24.000Z","size":676,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T08:12:56.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aybabtme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-18T06:19:58.000Z","updated_at":"2014-03-30T18:09:25.000Z","dependencies_parsed_at":"2022-09-10T19:23:00.237Z","dependency_job_id":null,"html_url":"https://github.com/aybabtme/bombjava","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybabtme%2Fbombjava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybabtme%2Fbombjava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybabtme%2Fbombjava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybabtme%2Fbombjava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aybabtme","download_url":"https://codeload.github.com/aybabtme/bombjava/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244633877,"owners_count":20485019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T18:09:00.597Z","updated_at":"2025-03-20T14:43:07.369Z","avatar_url":"https://github.com/aybabtme.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bombjava\n\nJava client [bomberman](https://github.com/aybabtme/bomberman) client.\n\n# Quickstart\n\nIt’s dangerous to go alone! Take this [jar](https://github.com/aybabtme/bombjava/raw/master/dist/bombjava.jar).\n\nThen\n```java\n// import the files\nimport im.antoine.bombjava.Client;\nimport im.antoine.bombjava.GameState;\nimport im.antoine.bombjava.PlayerState;\n```\n\nNow use the client!\n```java\n// Prepare the client\nClient c = new Client(\"127.0.0.1\", 40000);\n\n// Open the client resources\nc.open();\n\n// Read states till no more!\nwhile (c.hasNext()) {\n    GameState state = c.nextState();\n    doMove(state, c);\n}\n\n// Cleanup the client resources\nc.close();\n```\n\nYou can then consume the `GameState` object any way you want - it's immutable - and\nsend commands to the game through the client.\n\n```java\nprivate static void doMove(GameState state, Client c) throws IOException {\n\n  PlayerState p = state.getPlayerState();\n\n  System.out.printf(\"I'm %s, at (%d, %d)\\n\", p.getName(), p.getX(), p.getY());\n\n  Random r = new Random(System.nanoTime());\n  switch (r.nextInt(4)) {\n    case 0:\n      c.goUp();\n      break;\n    case 1:\n      c.goDown();\n      break;\n    case 2:\n      c.goLeft();\n      break;\n    case 3:\n      c.goRight();\n      break;\n  }\n}\n```\n\nPrints\n\n```\nI'm p2, at (46, 15)\nI'm p2, at (46, 15)\nI'm p2, at (47, 15)\nI'm p2, at (48, 15)\nI'm p2, at (47, 15)\nI'm p2, at (48, 15)\nI'm p2, at (49, 15)\nI'm p2, at (48, 15)\n```\n\n# Docs\n\nJavadocs aren't available at this time.  However, the objects are pretty simple.  Feel\nfree to submit docs in a PR if you feel like it.\n\n## `Client`\n\nEach call to `Client` is a call to the network, so they will all block.\n\n## `GameState`\n\nAll the values in `GameState` objects are actual values. They are also immutable.\n\nNo call to `GameState` will block.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faybabtme%2Fbombjava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faybabtme%2Fbombjava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faybabtme%2Fbombjava/lists"}