id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
17612803_210 | {
"fields": [],
"file": "CodingDojo/games/tetris/src/test/java/com/codenjoy/dojo/tetris/model/FigureImplTest.java",
"identifier": "FigureImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldRotateFigureL() {\n Figure figure = Type.L.create();\n\n assertDimensions(\"'L' WH(2:3) LR(0,1) TB(1,1)\", figure);\n assertEqCodes(new int[]{0b011000, 0b011000, 0b011011}, figure);\n\n figure.rotate(1);\n\n assertDimensions(\"'L' WH(3:2) LR(1... | {
"fields": [
{
"declarator": "x",
"modifier": "private",
"original_string": "private int x;",
"type": "int",
"var_name": "x"
},
{
"declarator": "y",
"modifier": "private",
"original_string": "private int y;",
"type": "int",
"var_name": "y"
}... | {
"body": "public Figure rotate(int times) {\n int realRotates = times % 4;\n for (int i = 0; i < realRotates; i++) {\n performRotate();\n }\n return this;\n }",
"class_method_signature": "FigureImpl.rotate(int times)",
"constructor": false,
"full_signature": "public Fi... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_640 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Reversi game;",
"type": "Reversi",
"var_name": "game"
},
{
"declarator": "hero1",
"modifier": "private",
"original_string": "private Hero hero1;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldChangeChip_blackGoesFirst() {\n givenFl(\" \" +\n \" \" +\n \" \" +\n \" xO \" +\n \" Ox \" +\n \" \" +\n \" \" +\n \" ... | {
"fields": [
{
"declarator": "flipper",
"modifier": "private",
"original_string": "private Flipper flipper;",
"type": "Flipper",
"var_name": "flipper"
},
{
"declarator": "chips",
"modifier": "private",
"original_string": "private List<Chip> chips;",
"... | {
"body": "@Override\n public void tick() {\n if (isGameOver()) {\n resetField(level);\n return;\n }\n\n getHeroes().forEach(Hero::tick);\n\n if (stop()) {\n return;\n }\n\n if (isGameOver()) {\n whoWin();\n }\n nex... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_986 | {
"fields": [
{
"declarator": "VASYA = \"vasya\"",
"modifier": "public static final",
"original_string": "public static final String VASYA = \"vasya\";",
"type": "String",
"var_name": "VASYA"
},
{
"declarator": "VASYA_AI = \"vasya-super-ai\"",
"modifier": "public ... | {
"body": "@Test\n public void shouldContinueTicks_whenExceptionInNewGame() {\n // given\n createPlayer(VASYA);\n createPlayer(PETYA);\n\n Game game1 = createGame(gameField(VASYA));\n Game game2 = createGame(gameField(PETYA));\n setNewGames(game1, game2);\n\n setup(... | {
"fields": [
{
"declarator": "lock = new ReentrantReadWriteLock(true)",
"modifier": "private",
"original_string": "private ReadWriteLock lock = new ReentrantReadWriteLock(true);",
"type": "ReadWriteLock",
"var_name": "lock"
},
{
"declarator": "cacheBoards = new HashMap... | {
"body": "@Override\n public void tick() {\n lock.writeLock().lock();\n try {\n profiler.start(\"PlayerService.tick()\");\n\n actionLogger.log(playerGames);\n autoSaver.tick();\n\n playerGames.tick();\n sendScreenUpdates();\n requestC... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_969 | {
"fields": [
{
"declarator": "HASH = \"someHash\"",
"modifier": "public static final",
"original_string": "public static final String HASH = \"someHash\";",
"type": "String",
"var_name": "HASH"
},
{
"declarator": "CODE_FOR_ID_AND_PASS = \"4486751343675417965\"",
... | {
"body": "@Test\n public void shouldCheckUser_badId() {\n // given\n String id = \"bad_id\";\n\n // when\n String actualId = service.checkUser(id);\n\n // then\n assertEquals(true, StringUtils.isEmpty(actualId));\n }",
"class_method_signature": "RegistrationTest.shou... | {
"fields": [
{
"declarator": "ADMIN_USER_ID = 0",
"modifier": "public static final",
"original_string": "public static final int ADMIN_USER_ID = 0;",
"type": "int",
"var_name": "ADMIN_USER_ID"
},
{
"declarator": "pool",
"modifier": "private",
"original_stri... | {
"body": "public String checkUser(String id) {\n if (getCodeById(id) != null) {\n return id;\n } else {\n return null;\n }\n }",
"class_method_signature": "Registration.checkUser(String id)",
"constructor": false,
"full_signature": "public String checkUser(String i... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_590 | {
"fields": [
{
"declarator": "LAYER_1 = 0",
"modifier": "public static final",
"original_string": "public static final int LAYER_1 = 0;",
"type": "int",
"var_name": "LAYER_1"
},
{
"declarator": "LAYER_2 = 1",
"modifier": "public static final",
"original_str... | {
"body": "@Test\n public void shouldWork_countNear_layer1() {\n assertEquals(2, board.countNear(LAYER_1, 0, 0, Elements.ONE));\n assertEquals(1, board.countNear(LAYER_1, 0, 0, Elements.TWO));\n assertEquals(0, board.countNear(LAYER_1, 0, 0, Elements.THREE));\n\n assertEquals(5, board.c... | {
"fields": [
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "field",
"modifier": "protected",
"original_string": "protected char[][][] field;",
"type": "c... | {
"body": "protected int countNear(int numLayer, int x, int y, E element) {\n if (pt(x, y).isOutOf(size)) {\n return 0;\n }\n return (int) getNear(numLayer, x, y).stream()\n .filter( it -> it.equals(element))\n .count();\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1062 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private RegistrationValidator validator;",
"type": "RegistrationValidator",
"var_name": "validator"
},
{
"declarator": "registration",
"modifier":... | {
"body": "@Test\n public void shouldRejectEmptyPassword() {\n // given\n player.setPassword(\"\");\n\n // when\n validator.validate(player, errors);\n \n // then\n assertError(errors, \"password\", \"registration.password.empty\");\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "nicknameAllowed",
"modifier": "@Value(\"${registration.nickname.allowed}\")\n private",
"original_string": "@Value(\"${registration.nickname.allowed}\")\n private boolean nicknameAllowed;",
"type": "boolean",
"var_name": "nicknameAllowed"
},
... | {
"body": "@Override\n public void validate(Object target, Errors errors) {\n if (target == null) {\n return;\n }\n\n Player player = (Player) target;\n\n String name = player.getReadableName();\n\n if (!validateNicknameStructure(name)) {\n errors.rejectValu... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_713 | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private IField field;",
"type": "IField",
"var_name": "field"
},
{
"declarator": "printer",
"modifier": "private",
"original_string": "private Printer<PrinterData> printer;",
... | {
"body": "@Test\n public void shouldDoNothingWhenNoCommands() {\n // given\n givenFl(\"╔═══┐\" +\n \"║...│\" +\n \"║.1.│\" +\n \"║...│\" +\n \"└───┘\");\n\n assertF(\"-=#-=#-=#-=#-=#\\n\" +\n \"-=#-=#-=#-=#-=#\\n\" +\n... | {
"fields": [
{
"declarator": "WIN_MULTIPLE = Events.WIN(data.winScore())",
"modifier": "public static final",
"original_string": "public static final Events WIN_MULTIPLE = Events.WIN(data.winScore());",
"type": "Events",
"var_name": "WIN_MULTIPLE"
},
{
"declarator": "D... | {
"body": "@Override\n public void tick() {\n if (logger.isDebugEnabled()) {\n logger.debug(\"Expansion {} started tick\", lg.id());\n }\n\n ticker.tick();\n\n if (isWaitingOthers()) return;\n\n roundTicks++;\n\n if (logger.isDebugEnabled()) {\n logge... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_343 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Quake2D game;",
"type": "Quake2D",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldStopWhenWallLeft() {\n givenFl(\"☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼☺ ☼\" +\n \"☼ ☼\" +\n \"☼☼☼☼☼\");\n\n hero.left();\n game.tick();\n\n assertE(\"☼☼☼☼☼\" +\n \"☼ ☼\" +\n ... | {
"fields": [
{
"declarator": "IS_DEAD = 1",
"modifier": "public static final",
"original_string": "public static final int IS_DEAD = 1;",
"type": "int",
"var_name": "IS_DEAD"
},
{
"declarator": "IS_ALIVE = 0",
"modifier": "public static final",
"original_st... | {
"body": "@Override\n public void tick() {\n// robots.addAll(robotsNew);\n// robotsNew.clear();\n\n takeAbility();\n checkBulletDirection();\n checkLifeCycleHero();\n// for (Robot robot : robots) {\n// robot.tick();\n// }\n\n if (counterOfAbility ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_656 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Reversi game;",
"type": "Reversi",
"var_name": "game"
},
{
"declarator": "hero1",
"modifier": "private",
"original_string": "private Hero hero1;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldFailIfNoTurnWithBreak_white() {\n givenFl(\" xOx ☼ \" +\n \" OO \" +\n \" ☼ \" +\n \" \" +\n \" \" +\n \" \" +\n \" \" +\n \" ... | {
"fields": [
{
"declarator": "flipper",
"modifier": "private",
"original_string": "private Flipper flipper;",
"type": "Flipper",
"var_name": "flipper"
},
{
"declarator": "chips",
"modifier": "private",
"original_string": "private List<Chip> chips;",
"... | {
"body": "@Override\n public void tick() {\n if (isGameOver()) {\n resetField(level);\n return;\n }\n\n getHeroes().forEach(Hero::tick);\n\n if (stop()) {\n return;\n }\n\n if (isGameOver()) {\n whoWin();\n }\n nex... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_206 | {
"fields": [],
"file": "CodingDojo/games/tetris/src/test/java/com/codenjoy/dojo/tetris/model/FigureImplTest.java",
"identifier": "FigureImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldProvideValidBinaryCodesWhenRowDefined() {\n assertThat(rowCodes(\"#\")).isEqualTo(new int[]{0b001});\n assertThat(rowCodes(\"##\")).isEqualTo(new int[]{0b001001});\n assertThat(rowCodes(\" # \")).isEqualTo(new int[]{0b000001000});\n }",
"class_method_s... | {
"fields": [
{
"declarator": "x",
"modifier": "private",
"original_string": "private int x;",
"type": "int",
"var_name": "x"
},
{
"declarator": "y",
"modifier": "private",
"original_string": "private int y;",
"type": "int",
"var_name": "y"
}... | {
"body": "@Override\n public int[] rowCodes(boolean ignoreColors) {\n if (ignoreColors) {\n return uncoloredCodes;\n }\n return codes;\n }",
"class_method_signature": "FigureImpl.rowCodes(boolean ignoreColors)",
"constructor": false,
"full_signature": "@Override public int... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_528 | {
"fields": [
{
"declarator": "json",
"modifier": "private",
"original_string": "private JSONObject json;",
"type": "JSONObject",
"var_name": "json"
}
],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/services/multiplayer/LevelProgressTest.java",
"identifi... | {
"body": "@Test\n public void constructFromJSONString_invalidJson() {\n // given\n String json = \"bad_data\";\n\n // when\n try {\n LevelProgress.parse(json);\n fail();\n } catch (Exception e) {\n // then\n assertEquals(\"Bad progress... | {
"fields": [
{
"declarator": "total",
"modifier": "protected",
"original_string": "protected int total;",
"type": "int",
"var_name": "total"
},
{
"declarator": "current",
"modifier": "protected",
"original_string": "protected int current;",
"type": "i... | {
"body": "public static LevelProgress parse(String jsonString) {\n JSONObject json;\n try {\n json = new JSONObject(jsonString);\n } catch (Exception e) {\n throw jsonFormatError(e, jsonString);\n }\n return new LevelProgress(json);\n }",
"class_method_si... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_178 | {
"fields": [
{
"declarator": "EMPTY = new LinkedList<Number>()",
"modifier": "private static final",
"original_string": "private static final List<Number> EMPTY = new LinkedList<Number>();",
"type": "List<Number>",
"var_name": "EMPTY"
}
],
"file": "CodingDojo/games/a2048/src... | {
"body": "@Test\n public void shouldCantGo_withBreaksVertical() {\n Numbers numbers = new Numbers(\n Arrays.asList(\n new Number(4, pt(0, 0)),\n new Number(2, pt(0, 1))),\n 2,\n Arrays.asList(\n ... | {
"fields": [
{
"declarator": "NONE = 0",
"modifier": "public static final",
"original_string": "public static final int NONE = 0;",
"type": "int",
"var_name": "NONE"
},
{
"declarator": "BREAK = -1",
"modifier": "public static final",
"original_string": "pub... | {
"body": "public boolean canGo(Mirror data) {\n for (int x = 0; x < size; x++) {\n for (int y = 0; y < size; y++) {\n if (data.get(x, y) == NONE) {\n return true;\n }\n }\n\n for (int y1 = 0; y1 < size - 1; y1++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_482 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Kata game;",
"type": "Kata",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
"v... | {
"body": "@Test\n public void shouldNoAnswersAtStartAfterTick() {\n givenQA(\"question1=answer1\",\n \"question2=answer2\",\n \"question3=answer3\");\n\n // when\n game.tick();\n\n thenHistory(\"[]\");\n\n thenQuestions(\"[\\n\" +\n \... | {
"fields": [
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
"type": "List<Player>",
"var_name": "players"
},
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n player.checkAnswer();\n }\n }",
"class_method_signature": "Kata.tick()",
"constructor": false,
"full_signature": "@Override public void tick()",
"identifier": "tick",
"invocations": [
"checkAns... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_197 | {
"fields": [],
"file": "CodingDojo/games/tetris/src/test/java/com/codenjoy/dojo/tetris/model/GlassEventTest.java",
"identifier": "GlassEventTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldEqualsEventsWhenSameCountLinesRemovedInLinesRemovedEventType() {\n GlassEvent event = new GlassEvent(LINES_REMOVED, 4);\n\n assertTrue(event.equals(new GlassEvent(LINES_REMOVED, 4)));\n }",
"class_method_signature": "GlassEventTest.shouldEqualsEventsWhenSameC... | {
"fields": [
{
"declarator": "type",
"modifier": "private",
"original_string": "private Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "value",
"modifier": "private",
"original_string": "private T value;",
"type": "T",
"var_n... | {
"body": "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n GlassEvent that = (GlassEvent) o;\n\n if (type != that.type) return false;\n\n if (value == null || that.value == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_894 | {
"fields": [],
"file": "CodingDojo/games/lunolet/src/test/java/com/codenjoy/dojo/lunolet/model/SimulatorTest.java",
"identifier": "SimulatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void landing_VerticalFreeFallFrom20cm_LandOnMountainTop() {\n Simulator sut = new Simulator();\n sut.Status.Y = 0.2;\n sut.Status.State = VesselState.FLIGHT;\n\n sut.Relief.clear();\n sut.Relief.add(new Point2D.Double(-50, -50));\n sut.Relief.add(... | {
"fields": [
{
"declarator": "Eps = 1e-5",
"modifier": "",
"original_string": "double Eps = 1e-5;",
"type": "double",
"var_name": "Eps"
},
{
"declarator": "GravityAccel = 1.62",
"modifier": "",
"original_string": "double GravityAccel = 1.62;",
"type":... | {
"body": "public void simulate(double angle, double mass, double duration) {\n if (mass < 0.0)\n throw new IllegalArgumentException(\"mass should be positive number or zero.\");\n if (duration <= 0.0)\n throw new IllegalArgumentException(\"duration should be positive number.\");\n... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_314 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n\tpublic void shouldTankCanGoIfRiverAtWay() {\n givenFl(\"☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼▓ ☼\\n\" +\n \"☼▲ ☼\\n\" +\n \"☼☼☼☼☼☼☼\\n\");\n\n hero(... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_744 | {
"fields": [],
"file": "CodingDojo/games/expansion/src/test/java/com/codenjoy/dojo/expansion/model/ForcesMovesTest.java",
"identifier": "ForcesMovesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParse_upperCaseDirection() {\n JSONObject json = new JSONObject(\"{region:{x:3, y:4}, direction:'LEFT_DOWN', count:2}\");\n\n // when\n ForcesMoves forces = new ForcesMoves(json);\n\n // then\n assertEquals(2, forces.getCount());\n assert... | {
"fields": [
{
"declarator": "direction",
"modifier": "private",
"original_string": "private QDirection direction;",
"type": "QDirection",
"var_name": "direction"
}
],
"file": "CodingDojo/games/expansion/src/main/java/com/codenjoy/dojo/expansion/model/ForcesMoves.java",
"i... | {
"body": "public String getDirection() {\n return direction.toString();\n }",
"class_method_signature": "ForcesMoves.getDirection()",
"constructor": false,
"full_signature": "public String getDirection()",
"identifier": "getDirection",
"invocations": [
"toString"
],
"modifiers": "public",... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1035 | {
"fields": [
{
"declarator": "NEVER = 0",
"modifier": "private static final",
"original_string": "private static final int NEVER = 0;",
"type": "int",
"var_name": "NEVER"
},
{
"declarator": "ONCE = 1",
"modifier": "public static final",
"original_string": "... | {
"body": "@Test\n public void shouldNewPlayerGoToFirstLevel_forTraining() {\n // given\n createPlayer(\"player1\", MultiplayerType.TRAINING.apply(3));\n createPlayer(\"player2\", MultiplayerType.TRAINING.apply(3));\n\n // when\n playerGames.tick();\n\n // then\n as... | {
"fields": [
{
"declarator": "ALL = true",
"modifier": "public static final",
"original_string": "public static final boolean ALL = true;",
"type": "boolean",
"var_name": "ALL"
},
{
"declarator": "ACTIVE = !ALL",
"modifier": "public static final",
"original... | {
"body": "@Override\n public void tick() {\n List<PlayerGame> active = active();\n\n // по всем джойстикам отправили сообщения играм\n active.forEach(PlayerGame::quietTick);\n\n // если в TRAINING кто-то isWin то мы его относим на следующий уровень\n // если в DISPOSABLE уровнях... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_251 | {
"fields": [
{
"declarator": "factory = new LevelsFactory()",
"modifier": "private",
"original_string": "private LevelsFactory factory = new LevelsFactory();",
"type": "LevelsFactory",
"var_name": "factory"
}
],
"file": "CodingDojo/games/tetris/src/test/java/com/codenjoy/doj... | {
"body": "@Test\n public void shouldLoadClass(){\n Levels loaded = factory.createLevels(\"HardLevels\", mock(Dice.class),\n mock(Figures.class)\n );\n\n assertEquals(HardLevels.class, loaded.getClass());\n }",
"class_method_signature": "LevelsFactoryTest.shouldLoadClass()"... | {
"fields": [],
"file": "CodingDojo/games/tetris/src/main/java/com/codenjoy/dojo/tetris/model/levels/LevelsFactory.java",
"identifier": "LevelsFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "LevelsFactory.allLevels()",
"constructor": false,
"full_signature": "public... | {
"body": "public Levels createLevels(String level, Dice dice, FigureQueue playerQueue) {\n String className = LevelsFactory.class.getPackage().getName() + \".level.\" + level;\n try {\n Class<?> aClass = this.getClass().getClassLoader().loadClass(className);\n Constructor<?> const... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_601 | {
"fields": [
{
"declarator": "INITIAL =\n \" WWW \" +\n \" WWW \" +\n \" WWW \" +\n \"BBBOOOGGGRRR\" +\n \"BBBOOOGGGRRR\" +\n \"BBBOOOGGGRRR\" +\n \" YYY \" +\n \" YYY \" +\n ... | {
"body": "@Test\n public void shouldGivenF_() {\n givenFl(\"F'\");\n\n assertE(\" WWW \" +\n \" WWW \" +\n \" GGG \" +\n \"BBWOOOYGGRRR\" +\n \"BBWOOOYGGRRR\" +\n \"BBWOOOYGGRRR\" +\n \" ... | {
"fields": [
{
"declarator": "cube",
"modifier": "private",
"original_string": "private Cube cube;",
"type": "Cube",
"var_name": "cube"
},
{
"declarator": "cells",
"modifier": "private",
"original_string": "private CellsAdapter cells;",
"type": "Cells... | {
"body": "@Override\n public void tick() {\n if (gameOver) return;\n String command = player.getHero().pullCommand();\n if (command == null) return;\n\n cube.doCommand(command);\n\n checkIsWin();\n }",
"class_method_signature": "RubicsCube.tick()",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_676 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Fifteen game;",
"type": "Fifteen",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldMoveDown() {\n givenFl(\"******\" +\n \"*abcd*\" +\n \"*efgh*\" +\n \"*ijk+*\" +\n \"*mnol*\" +\n \"******\");\n\n hero.down();\n game.tick();\n\n assertE(\"******\" +\n ... | {
"fields": [
{
"declarator": "level",
"modifier": "private final",
"original_string": "private final Level level;",
"type": "Level",
"var_name": "level"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n Hero hero = player.getHero();\n hero.tick();\n\n if(isAllPositionCorrect()){\n player.event(Events.WIN);\n player.getHero().die();\n }\n }\n }",... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_226 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Tetris game;",
"type": "Tetris",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldDropFirstFigure_whenL() {\n givenFl(\"......\" +\n \"......\" +\n \"......\" +\n \"......\" +\n \"......\" +\n \"......\");\n\n when(queue.next()).thenReturn(Type.L.create());\n game... | {
"fields": [
{
"declarator": "queue",
"modifier": "protected",
"original_string": "protected FigureQueue queue;",
"type": "FigureQueue",
"var_name": "queue"
},
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"typ... | {
"body": "public void tick() {\n player.getHero().tick();\n }",
"class_method_signature": "Tetris.tick()",
"constructor": false,
"full_signature": "public void tick()",
"identifier": "tick",
"invocations": [
"tick",
"getHero"
],
"modifiers": "public",
"parameters": "()",
"return":... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1042 | {
"fields": [
{
"declarator": "NEVER = 0",
"modifier": "private static final",
"original_string": "private static final int NEVER = 0;",
"type": "int",
"var_name": "NEVER"
},
{
"declarator": "ONCE = 1",
"modifier": "public static final",
"original_string": "... | {
"body": "@Test\n public void testChangeRoom_caseTournament() {\n // given\n MultiplayerType type = MultiplayerType.TOURNAMENT;\n createPlayer(\"player1\", \"room\", \"game\", type);\n createPlayer(\"player2\", \"room\", \"game\", type);\n createPlayer(\"player3\", \"room\", \"g... | {
"fields": [
{
"declarator": "ALL = true",
"modifier": "public static final",
"original_string": "public static final boolean ALL = true;",
"type": "boolean",
"var_name": "ALL"
},
{
"declarator": "ACTIVE = !ALL",
"modifier": "public static final",
"original... | {
"body": "public void changeRoom(String playerId, String roomName) {\n if (roomName == null) {\n return;\n }\n PlayerGame playerGame = get(playerId);\n JSONObject save = playerGame.getGame().getSave();\n Game game = playerGame.getGame();\n reload(game, roomName, s... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_6 | {
"fields": [],
"file": "CodingDojo/games/icancode/src/test/java/com/codenjoy/dojo/icancode/services/LevelsTest.java",
"identifier": "LevelsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLevelC2() {\n String map = getMap(new LevelC2().map());\n\n asrtMap(\" \" +\n \" \" +\n \" ####### \" +\n \" #S.O..# \" +\n \" ####..# \" +\n ... | {
"fields": [
{
"declarator": "VIEW_SIZE = 20",
"modifier": "public static",
"original_string": "public static int VIEW_SIZE = 20;",
"type": "int",
"var_name": "VIEW_SIZE"
},
{
"declarator": "VIEW_SIZE_TESTING = 16",
"modifier": "public static final",
"origi... | {
"body": "public static String decorate(String level) {\n LengthToXY.Map map = new LengthToXY.Map(level);\n LengthToXY.Map out = new LengthToXY.Map(map.getSize());\n for (int x = 0; x < map.getSize(); ++x) {\n for (int y = 0; y < map.getSize(); ++y) {\n char at = map.ge... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_733 | {
"fields": [
{
"declarator": "LEVEL_SIZE = 16",
"modifier": "public static final",
"original_string": "public static final int LEVEL_SIZE = 16;",
"type": "int",
"var_name": "LEVEL_SIZE"
}
],
"file": "CodingDojo/games/expansion/src/test/java/com/codenjoy/dojo/expansion/model/... | {
"body": "@Test\n public void testMultiLevel3() {\n String map = getMap(Levels.MULTI.get(2));\n asrtMap(\"╔══════════════════┐\" +\n \"║O$O$O$O$O$O$O$O$O$│\" +\n \"║$O.O.O.O.O.O.O.O.O│\" +\n \"║O.....O.O.O.O.O.O$│\" +\n \"║$..1.......O........ | {
"fields": [
{
"declarator": "logger = DLoggerFactory.getLogger(Levels.class)",
"modifier": "private static",
"original_string": "private static Logger logger = DLoggerFactory.getLogger(Levels.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "COUNT_L... | {
"body": "public static String get(String name) {\n return levels.get(name);\n }",
"class_method_signature": "Levels.get(String name)",
"constructor": false,
"full_signature": "public static String get(String name)",
"identifier": "get",
"invocations": [
"get"
],
"modifiers": "public stat... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_363 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Loderunner game;",
"type": "Loderunner",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Her... | {
"body": "@Test\n public void shouldStopWhenNoMoreRightCommand() {\n shouldMoveRight();\n\n game.tick();\n\n assertE(\"☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼ ►☼\" +\n \"☼###☼\" +\n \"☼☼☼☼☼\");\n }",
"class_method_signature": "Loderunner... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private Point[][] field;",
"type": "Point[][]",
"var_name": "field"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n Set<Player> die = new HashSet<>();\n\n heroesGo();\n die.addAll(getDied());\n\n enemiesGo();\n die.addAll(getDied());\n\n die.addAll(bricksGo());\n\n for (Player player : die) {\n player.event(Events.KILL_HERO... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_699 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private StartAndJump game;",
"type": "StartAndJump",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": ... | {
"body": "@Test\n public void shouldJumpOnPlatform() {\n givenFl(\" \" +\n \" \" +\n \" \" +\n \"☺ \" +\n \"= == \" +\n \" \" +\n \"#######\");\n\n hero.up();\n game.tick()... | {
"fields": [
{
"declarator": "MAX_PLATFORM_LENGTH = 3",
"modifier": "public static final",
"original_string": "public static final int MAX_PLATFORM_LENGTH = 3;",
"type": "int",
"var_name": "MAX_PLATFORM_LENGTH"
},
{
"declarator": "platformGenerator",
"modifier": ... | {
"body": "@Override\n public void tick() {\n tickCounter++;\n platforms.addAll(platformGenerator.generateRandomPlatforms());\n\n // set player JUMPING status and/or jumpCounter since last IDLE\n for (Player player : players) {\n Hero hero = player.getHero();\n her... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_949 | {
"fields": [],
"file": "CodingDojo/server/src/test/java/com/codenjoy/dojo/services/BoardGameStateTest.java",
"identifier": "BoardGameStateTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n BoardGameState state = new BoardGameState(\"brd\");\n assertEquals(\"board=brd\", state.asString());\n }",
"class_method_signature": "BoardGameStateTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "tes... | {
"fields": [
{
"declarator": "board",
"modifier": "private",
"original_string": "private String board;",
"type": "String",
"var_name": "board"
}
],
"file": "CodingDojo/server/src/main/java/com/codenjoy/dojo/services/BoardGameState.java",
"identifier": "BoardGameState",
"... | {
"body": "@Override\n public String asString() {\n return \"board=\" + board;\n }",
"class_method_signature": "BoardGameState.asString()",
"constructor": false,
"full_signature": "@Override public String asString()",
"identifier": "asString",
"invocations": [],
"modifiers": "@Override public... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_92 | {
"fields": [
{
"declarator": "BOARD_SIZE = 9",
"modifier": "private static final",
"original_string": "private static final int BOARD_SIZE = 9;",
"type": "int",
"var_name": "BOARD_SIZE"
},
{
"declarator": "SNAKE_SIZE = 2",
"modifier": "private static final",
... | {
"body": "@Test\n public void shouldSnakeLengthIs5_ifYouWant() {\n givenBoardWithSnakeSize(5);\n\n // then\n asrtBrd(\"☼☼☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ╘► ☼\\n\" +\n ... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private Walls walls;",
"type": "Walls",
"var_name": "walls"
},
{
"declarator": "stone",
"modifier": "private",
"original_string": "private Stone stone;",
"type": "Stone",... | {
"body": "@Override\n public void tick() {\n if (!snake().isAlive()) return;\n\n snake().walk(this);\n }",
"class_method_signature": "Snake.tick()",
"constructor": false,
"full_signature": "@Override public void tick()",
"identifier": "tick",
"invocations": [
"isAlive",
"snake",... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_271 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldBulletDestroyWall_whenHittingTheWallUp_overWall() {\n givenFl(\"☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼▼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼╬ ☼\\n\" +\n \"☼☼☼... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_621 | {
"fields": [
{
"declarator": "INITIAL =\n \" WWW \" +\n \" WWW \" +\n \" WWW \" +\n \"BBBOOOGGGRRR\" +\n \"BBBOOOGGGRRR\" +\n \"BBBOOOGGGRRR\" +\n \" YYY \" +\n \" YYY \" +\n ... | {
"body": "@Test\n public void shouldSuccessEventWhenSuccess() {\n givenFl(\"R'\");\n\n joystick.act(RIGHT, CLOCKWISE);\n game.tick();\n\n verify(listener).event(Events.SUCCESS);\n verifyNoMoreInteractions(listener);\n }",
"class_method_signature": "RubicsCubeTest.shouldSucc... | {
"fields": [
{
"declarator": "cube",
"modifier": "private",
"original_string": "private Cube cube;",
"type": "Cube",
"var_name": "cube"
},
{
"declarator": "cells",
"modifier": "private",
"original_string": "private CellsAdapter cells;",
"type": "Cells... | {
"body": "@Override\n public void tick() {\n if (gameOver) return;\n String command = player.getHero().pullCommand();\n if (command == null) return;\n\n cube.doCommand(command);\n\n checkIsWin();\n }",
"class_method_signature": "RubicsCube.tick()",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_334 | {
"fields": [
{
"declarator": "board",
"modifier": "private",
"original_string": "private Board board;",
"type": "Board",
"var_name": "board"
}
],
"file": "CodingDojo/games/battlecity/src/test/java/com/codenjoy/dojo/battlecity/client/BoardTest.java",
"identifier": "BoardTes... | {
"body": "@Test\n public void shouldWork_getAt() {\n assertEquals(Elements.OTHER_TANK_DOWN, board.getAt(1, 4));\n assertEquals(Elements.BATTLE_WALL, board.getAt(0, 8));\n assertEquals(Elements.WALL, board.getAt(6, 1));\n }",
"class_method_signature": "BoardTest.shouldWork_getAt()",
"co... | {
"fields": [],
"file": "CodingDojo/games/battlecity/src/main/java/com/codenjoy/dojo/battlecity/client/Board.java",
"identifier": "Board",
"interfaces": "",
"methods": [
{
"class_method_signature": "Board.valueOf(char ch)",
"constructor": false,
"full_signature": "@Override public Elemen... | {
"body": "public Elements getAt(int x, int y) {\n if (isOutOfField(x, y)) {\n return Elements.BATTLE_WALL;\n }\n return super.getAt(x, y);\n }",
"class_method_signature": "Board.getAt(int x, int y)",
"constructor": false,
"full_signature": "public Elements getAt(int x, int y)... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_764 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Moebius game;",
"type": "Moebius",
"var_name": "game"
},
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
"type": "Dice",
... | {
"body": "@Test\n public void shouldRemoveLine_whenCycling2() {\n givenFl(\"╔═══╗\" +\n \"║╔═╗║\" +\n \"║║ ║║\" +\n \"║╚═╗║\" +\n \"╚═══╝\");\n\n joystick.act(3, 1);\n dice(1, 1, 1);\n game.tick();\n\n verifyEvent(new E... | {
"fields": [
{
"declarator": "lines",
"modifier": "private",
"original_string": "private List<Line> lines;",
"type": "List<Line>",
"var_name": "lines"
},
{
"declarator": "level",
"modifier": "private final",
"original_string": "private final Level level;",
... | {
"body": "@Override\n public void tick() {\n Point act = player.getHero();\n if (!act.isOutOf(size)) {\n int index = lines.indexOf(act);\n if (index != -1) {\n Line line = lines.get(index);\n line.rotate();\n } else {\n //... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1015 | {
"fields": [
{
"declarator": "NEVER = 0",
"modifier": "private static final",
"original_string": "private static final int NEVER = 0;",
"type": "int",
"var_name": "NEVER"
},
{
"declarator": "ONCE = 1",
"modifier": "public static final",
"original_string": "... | {
"body": "@Test\n public void testGetByGamePlayer() {\n // given\n Player player = createPlayer();\n\n // when\n PlayerGame playerGame = playerGames.get(gamePlayers.get(0));\n\n // then\n assertEquals(gamePlayers.get(0), playerGame.getGame().getPlayer());\n assertE... | {
"fields": [
{
"declarator": "ALL = true",
"modifier": "public static final",
"original_string": "public static final boolean ALL = true;",
"type": "boolean",
"var_name": "ALL"
},
{
"declarator": "ACTIVE = !ALL",
"modifier": "public static final",
"original... | {
"body": "public PlayerGame get(String id) {\n return all.stream()\n .filter(pg -> pg.getPlayer().getId().equals(id))\n .findFirst()\n .orElse(NullPlayerGame.INSTANCE);\n }",
"class_method_signature": "PlayerGames.get(String id)",
"constructor": false,
"fu... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_508 | {
"fields": [],
"file": "CodingDojo/games/kata/src/test/java/com/codenjoy/dojo/kata/model/levels/algorithms/FizzBuzzAlgorithmTest.java",
"identifier": "FizzBuzzAlgorithmTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldWork() {\n FizzBuzzAlgorithm algorithm = new FizzBuzzAlgorithm();\n assertEquals(\"1\", algorithm.get(\"1\"));\n assertEquals(\"2\", algorithm.get(\"2\"));\n assertEquals(\"Fizz\", algorithm.get(\"3\"));\n assertEquals(\"4\", algorithm.get(\"4... | {
"fields": [],
"file": "CodingDojo/games/kata/src/main/java/com/codenjoy/dojo/kata/model/levels/algorithms/FizzBuzzAlgorithm.java",
"identifier": "FizzBuzzAlgorithm",
"interfaces": "",
"methods": [
{
"class_method_signature": "FizzBuzzAlgorithm.get(int i)",
"constructor": false,
"full_s... | {
"body": "@Override\n public String get(int i) {\n String result = \"\";\n if (i % 3 == 0) {\n result += \"Fizz\";\n }\n if (i % 5 == 0) {\n result += \"Buzz\";\n }\n if (result.length() == 0) {\n result = String.valueOf(i);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_158 | {
"fields": [
{
"declarator": "EMPTY = new LinkedList<Number>()",
"modifier": "private static final",
"original_string": "private static final List<Number> EMPTY = new LinkedList<Number>();",
"type": "List<Number>",
"var_name": "EMPTY"
}
],
"file": "CodingDojo/games/a2048/src... | {
"body": "@Test\n public void shouldMoveLeft() {\n Numbers numbers = new Numbers(Arrays.asList(new Number(4, pt(1, 1))), 4, EMPTY);\n\n assertN(\"....\" +\n \"....\" +\n \".4..\" +\n \"....\", numbers);\n\n numbers.move(Direction.LEFT);\n\n ... | {
"fields": [
{
"declarator": "NONE = 0",
"modifier": "public static final",
"original_string": "public static final int NONE = 0;",
"type": "int",
"var_name": "NONE"
},
{
"declarator": "BREAK = -1",
"modifier": "public static final",
"original_string": "pub... | {
"body": "public void move(Direction direction) {\n switch (direction) {\n case RIGHT : merge(this.new _XY()); break;\n case UP : merge(this.new Y_X()); break;\n case LEFT : merge(this.new XY()); break;\n case DOWN : merge(this.new YX()); break;\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_637 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Reversi game;",
"type": "Reversi",
"var_name": "game"
},
{
"declarator": "hero1",
"modifier": "private",
"original_string": "private Hero hero1;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldNotChangeSeveralChips_whenNoSupportChipInOtherSide_black() {\n givenFl(\"X \" +\n \"o o \" +\n \" o \" +\n \" ooo oo \" +\n \" o \" +\n \" o \" +\n \" o ... | {
"fields": [
{
"declarator": "flipper",
"modifier": "private",
"original_string": "private Flipper flipper;",
"type": "Flipper",
"var_name": "flipper"
},
{
"declarator": "chips",
"modifier": "private",
"original_string": "private List<Chip> chips;",
"... | {
"body": "@Override\n public void tick() {\n if (isGameOver()) {\n resetField(level);\n return;\n }\n\n getHeroes().forEach(Hero::tick);\n\n if (stop()) {\n return;\n }\n\n if (isGameOver()) {\n whoWin();\n }\n nex... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_267 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldBulletDestroyWall_whenHittingTheWallUp() {\n givenFl(\"☼☼☼☼☼☼☼\\n\" +\n \"☼▼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼╬ ☼\\n\" +\n \"☼☼☼☼☼☼☼\\n\"... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1003 | {
"fields": [
{
"declarator": "playerScores",
"modifier": "private",
"original_string": "private PlayerScores playerScores;",
"type": "PlayerScores",
"var_name": "playerScores"
},
{
"declarator": "collector",
"modifier": "private",
"original_string": "privat... | {
"body": "@Test\n public void shouldIgnoreZeroPenalty() {\n when(playerScores.getScore()).thenReturn(0);\n\n snakeEatStone();\n snakeIsDead();\n\n assertEquals(null, collector.getMessage());\n assertNull(collector.getMessage());\n }",
"class_method_signature": "InformationC... | {
"fields": [
{
"declarator": "pool = new LinkedList<>()",
"modifier": "private",
"original_string": "private Deque<String> pool = new LinkedList<>();",
"type": "Deque<String>",
"var_name": "pool"
},
{
"declarator": "playerScores",
"modifier": "private",
"or... | {
"body": "@Override\n public String getMessage() {\n List<String> result = new LinkedList<>();\n String message;\n do {\n message = infoAboutLevelChangedMustBeLast(pool.pollFirst());\n if (message != null) {\n result.add(message);\n }\n }... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_772 | {
"fields": [
{
"declarator": "scores",
"modifier": "private",
"original_string": "private PlayerScores scores;",
"type": "PlayerScores",
"var_name": "scores"
},
{
"declarator": "settings",
"modifier": "private",
"original_string": "private OptionGameSetting... | {
"body": "@Test\n public void shouldCollectScores() {\n scores = new Scores(140, settings);\n\n killWall(); //+10\n killWall(); //+10\n killWall(); //+10\n killWall(); //+10\n\n killYourself(); //-50\n\n killMeatChopper(); //100\n\n killOtherHero(); //... | {
"fields": [
{
"declarator": "score",
"modifier": "private volatile",
"original_string": "private volatile int score;",
"type": "int",
"var_name": "score"
},
{
"declarator": "settings",
"modifier": "private",
"original_string": "private GameSettings setting... | {
"body": "@Override\n public Integer getScore() {\n return score;\n }",
"class_method_signature": "Scores.getScore()",
"constructor": false,
"full_signature": "@Override public Integer getScore()",
"identifier": "getScore",
"invocations": [],
"modifiers": "@Override public",
"parameters": ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_288 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldBulletCantGoIfWallAtWay() {\n givenFl(\"☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼☼ ☼\\n\" +\n \"☼▲ ☼\\n\" +\n \"☼☼☼☼☼☼☼\\n\");\n\n h... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_322 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldSwapElementAfterFourTicks() {\n hitKillsAiPrize = v(3);\n givenFl(\"☼☼☼☼☼☼☼☼☼\\n\" +\n \"☼ ?☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_908 | {
"fields": [
{
"declarator": "playerGamesView",
"modifier": "private",
"original_string": "private PlayerGamesView playerGamesView;",
"type": "PlayerGamesView",
"var_name": "playerGamesView"
},
{
"declarator": "playerGames",
"modifier": "private",
"original... | {
"body": "@Test\n public void testGetGroupsByField_usersInSameGroup() {\n // given\n givenUsersInSameGroup();\n\n // when\n List<List<String>> groups = playerGamesView.getGroupsByField();\n\n // then\n assertEquals(\"[[user1, user2, user3, user4]]\", // all together\n ... | {
"fields": [
{
"declarator": "service",
"modifier": "@Autowired\n protected",
"original_string": "@Autowired\n protected PlayerGames service;",
"type": "PlayerGames",
"var_name": "service"
}
],
"file": "CodingDojo/server/src/main/java/com/codenjoy/dojo/services/PlayerG... | {
"body": "public List<List<String>> getGroupsByField() {\n return getGroupBy(PlayerGame::getField);\n }",
"class_method_signature": "PlayerGamesView.getGroupsByField()",
"constructor": false,
"full_signature": "public List<List<String>> getGroupsByField()",
"identifier": "getGroupsByField",
"invo... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_230 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Tetris game;",
"type": "Tetris",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldRemoveLine_whenO_and6x6() {\n int level = 1;\n int figure = Type.O.getColor().index();\n givenFl(\"......\" +\n \"......\" +\n \"......\" +\n \"......\" +\n \"......\" +\n \"......\"... | {
"fields": [
{
"declarator": "queue",
"modifier": "protected",
"original_string": "protected FigureQueue queue;",
"type": "FigureQueue",
"var_name": "queue"
},
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"typ... | {
"body": "public void tick() {\n player.getHero().tick();\n }",
"class_method_signature": "Tetris.tick()",
"constructor": false,
"full_signature": "public void tick()",
"identifier": "tick",
"invocations": [
"tick",
"getHero"
],
"modifiers": "public",
"parameters": "()",
"return":... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_660 | {
"fields": [
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "builder",
"modifier": "private",
"original_string": "private LevelBuilder builder;",
"type": "L... | {
"body": "@Test\n public void testGetBoard() throws Exception {\n when(dice.next(8)).thenReturn(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3);\n builder = new LevelBuilder(dice, SIZE);\n\n assertB(\"☼☼☼☼\" +\n \"☼12☼\" +\n \"☼34☼\" +\n \"☼☼☼☼\... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private int[][] field;",
"type": "int[][]",
"var_name": "field"
},
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
... | {
"body": "public String getBoard() {\n StringBuffer result = new StringBuffer();\n\n char borderChar = Elements.BORDER.ch();\n for (int x = 0; x < size; x++) {\n for (int y = 0; y < size; y++) {\n if (x == 0 || y == 0 || x == size - 1 || y == size - 1) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_375 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Loderunner game;",
"type": "Loderunner",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Her... | {
"body": "@Test\n public void shouldDrillRight_onyActCommand() {\n givenFl(\"☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼ ► ☼\" +\n \"☼###☼\" +\n \"☼☼☼☼☼\");\n\n hero.act();\n game.tick();\n\n assertE(\"☼☼☼☼☼\" +\n \"☼ ☼\" +... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private Point[][] field;",
"type": "Point[][]",
"var_name": "field"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n Set<Player> die = new HashSet<>();\n\n heroesGo();\n die.addAll(getDied());\n\n enemiesGo();\n die.addAll(getDied());\n\n die.addAll(bricksGo());\n\n for (Player player : die) {\n player.event(Events.KILL_HERO... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_725 | {
"fields": [
{
"declarator": "lobbyBoard",
"modifier": "private",
"original_string": "private JSONObject lobbyBoard;",
"type": "JSONObject",
"var_name": "lobbyBoard"
},
{
"declarator": "lobbyLastActions",
"modifier": "private",
"original_string": "private M... | {
"body": "@Test\n public void shouldNotTickWhenNoMoreTicks_whenDelayReplay() {\n boolean old = data.delayReplay();\n try {\n data.delayReplay(false);\n\n // given\n ReplayGame game = createGame(3);\n\n // without clearScore, tick = 3\n // game.c... | {
"fields": [
{
"declarator": "START_FROM_TICK = \"startFromTick\"",
"modifier": "private static final",
"original_string": "private static final String START_FROM_TICK = \"startFromTick\";",
"type": "String",
"var_name": "START_FROM_TICK"
},
{
"declarator": "REPLAY_NAM... | {
"body": "public void tick() {\n if (!start) {\n return;\n }\n if (noMoreTicks()) {\n return;\n }\n tick++;\n }",
"class_method_signature": "ReplayGame.tick()",
"constructor": false,
"full_signature": "public void tick()",
"identifier": "tick",
"i... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1054 | {
"fields": [
{
"declarator": "mvc",
"modifier": "private",
"original_string": "private MockMvc mvc;",
"type": "MockMvc",
"var_name": "mvc"
},
{
"declarator": "context",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private WebAp... | {
"body": "@Test\n public void shouldSpritesNames() {\n assertEquals(\"[none, wall, hero]\", service.spritesNames(\"first\").toString());\n assertEquals(\"[none, red, green, blue]\", service.spritesNames(\"second\").toString());\n assertEquals(null, service.spritesNames(\"non-exists\"));\n\n ... | {
"fields": [
{
"declarator": "gameService",
"modifier": "private",
"original_string": "private GameService gameService;",
"type": "GameService",
"var_name": "gameService"
}
],
"file": "CodingDojo/server/src/main/java/com/codenjoy/dojo/web/rest/RestGameController.java",
"id... | {
"body": "@GetMapping(\"/{name}/sprites/names\")\n public List<String> spritesNames(@PathVariable(\"name\") String name) {\n if (!exists(name)) {\n return null;\n }\n\n return gameService.getSpritesNames().get(name);\n }",
"class_method_signature": "RestGameController.spritesN... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_84 | {
"fields": [
{
"declarator": "scores",
"modifier": "private",
"original_string": "private Scores scores;",
"type": "Scores",
"var_name": "scores"
},
{
"declarator": "settings",
"modifier": "private",
"original_string": "private Settings settings;",
"t... | {
"body": "@Test\n public void shouldClearScoreTogetherWithSnakeLength() {\n // given\n scores = getScores(0);\n\n snakeEatApple(); //+3\n snakeEatApple(); //+4\n snakeEatApple(); //+5\n snakeEatApple(); //+6\n snakeEatApple(); //+7\n snakeEatApple(); /... | {
"fields": [],
"file": "CodingDojo/games/snake/src/main/java/com/codenjoy/dojo/snake/services/MaxScores.java",
"identifier": "MaxScores",
"interfaces": "",
"methods": [
{
"class_method_signature": "MaxScores.MaxScores(int startScore, SnakeSettings setup)",
"constructor": true,
"full_sig... | {
"body": "@Override\n protected void snakeEatApple() {\n length++;\n\n int current = 0;\n for (int i = setup.startSnakeLength().getValue() + 1; i <= length; i++) {\n current += i;\n }\n\n score = Math.max(score, current);\n }",
"class_method_signature": "MaxScore... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_549 | {
"fields": [],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/services/PointImplTest.java",
"identifier": "PointImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSaveXY() {\n Point pt = pt(10, 12);\n\n assertEquals(10, pt.getX());\n assertEquals(12, pt.getY());\n }",
"class_method_signature": "PointImplTest.shouldSaveXY()",
"constructor": false,
"full_signature": "@Test public void shouldSaveXY()",
"ident... | {
"fields": [
{
"declarator": "x",
"modifier": "protected",
"original_string": "protected int x;",
"type": "int",
"var_name": "x"
},
{
"declarator": "y",
"modifier": "protected",
"original_string": "protected int y;",
"type": "int",
"var_name": "... | {
"body": "public static Point pt(int x, int y) {\n return new PointImpl(x, y);\n }",
"class_method_signature": "PointImpl.pt(int x, int y)",
"constructor": false,
"full_signature": "public static Point pt(int x, int y)",
"identifier": "pt",
"invocations": [],
"modifiers": "public static",
"pa... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_119 | {
"fields": [
{
"declarator": "BOARD_SIZE = 9",
"modifier": "private static final",
"original_string": "private static final int BOARD_SIZE = 9;",
"type": "int",
"var_name": "BOARD_SIZE"
},
{
"declarator": "SNAKE_SIZE = 2",
"modifier": "private static final",
... | {
"body": "@Test\n public void shouldGameOver_whenEatItself_case2() {\n givenBoardWithSnakeSize(5);\n board.tick();\n\n hero.down();\n board.tick();\n hero.left();\n board.tick();\n\n asrtBrd(\"☼☼☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private Walls walls;",
"type": "Walls",
"var_name": "walls"
},
{
"declarator": "stone",
"modifier": "private",
"original_string": "private Stone stone;",
"type": "Stone",... | {
"body": "@Override\n public void tick() {\n if (!snake().isAlive()) return;\n\n snake().walk(this);\n }",
"class_method_signature": "Snake.tick()",
"constructor": false,
"full_signature": "@Override public void tick()",
"identifier": "tick",
"invocations": [
"isAlive",
"snake",... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_861 | {
"fields": [
{
"declarator": "scores",
"modifier": "private",
"original_string": "private PlayerScores scores;",
"type": "PlayerScores",
"var_name": "scores"
},
{
"declarator": "parameters = new SettingsImpl()",
"modifier": "private",
"original_string": "pr... | {
"body": "@Test\n public void shouldStillZeroAfterForgotCharge() {\n scores = new Scores(0, parameters);\n\n minesweeperForgetCharge(); //-5\n\n assertEquals(0, scores.getScore());\n }",
"class_method_signature": "ScoresTest.shouldStillZeroAfterForgotCharge()",
"constructor": false,... | {
"fields": [
{
"declarator": "gameOverPenalty",
"modifier": "private final",
"original_string": "private final Parameter<Integer> gameOverPenalty;",
"type": "Parameter<Integer>",
"var_name": "gameOverPenalty"
},
{
"declarator": "destroyedPenalty",
"modifier": "pr... | {
"body": "@Override\n public Integer getScore() {\n return score;\n }",
"class_method_signature": "Scores.getScore()",
"constructor": false,
"full_signature": "@Override public Integer getScore()",
"identifier": "getScore",
"invocations": [],
"modifiers": "@Override public",
"parameters": ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_532 | {
"fields": [
{
"declarator": "json",
"modifier": "private",
"original_string": "private JSONObject json;",
"type": "JSONObject",
"var_name": "json"
}
],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/services/multiplayer/LevelProgressTest.java",
"identifi... | {
"body": "@Test\n public void nextLevel_skip_currentWillBeMoreThanPassed() {\n // given\n json = new JSONObject(\"{'levelProgress':{'total':3,'current':2,'lastPassed':0}}\");\n\n // when\n try {\n LevelProgress.winLevel(json);\n fail();\n } catch (IllegalAr... | {
"fields": [
{
"declarator": "total",
"modifier": "protected",
"original_string": "protected int total;",
"type": "int",
"var_name": "total"
},
{
"declarator": "current",
"modifier": "protected",
"original_string": "protected int current;",
"type": "i... | {
"body": "public static JSONObject winLevel(JSONObject json) {\n LevelProgress progress = new LevelProgress(json);\n JSONObject clone = new JSONObject(json.toString());\n\n progress.change(progress.current + 1,\n Math.max(progress.passed, progress.current));\n\n if (progres... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_10 | {
"fields": [],
"file": "CodingDojo/games/icancode/src/test/java/com/codenjoy/dojo/icancode/services/LevelsTest.java",
"identifier": "LevelsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLevelF2() {\n String map = getMap(new LevelF2().map());\n\n asrtMap(\" \" +\n \" \" +\n \" \" +\n \" ############ \" +\n \" #S.........# \" +\n ... | {
"fields": [
{
"declarator": "VIEW_SIZE = 20",
"modifier": "public static",
"original_string": "public static int VIEW_SIZE = 20;",
"type": "int",
"var_name": "VIEW_SIZE"
},
{
"declarator": "VIEW_SIZE_TESTING = 16",
"modifier": "public static final",
"origi... | {
"body": "public static String decorate(String level) {\n LengthToXY.Map map = new LengthToXY.Map(level);\n LengthToXY.Map out = new LengthToXY.Map(map.getSize());\n for (int x = 0; x < map.getSize(); ++x) {\n for (int y = 0; y < map.getSize(); ++y) {\n char at = map.ge... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_162 | {
"fields": [
{
"declarator": "EMPTY = new LinkedList<Number>()",
"modifier": "private static final",
"original_string": "private static final List<Number> EMPTY = new LinkedList<Number>();",
"type": "List<Number>",
"var_name": "EMPTY"
}
],
"file": "CodingDojo/games/a2048/src... | {
"body": "@Test\n public void shouldMoveRight() {\n Numbers numbers = new Numbers(Arrays.asList(new Number(4, pt(1, 1))), 4, EMPTY);\n\n assertN(\"....\" +\n \"....\" +\n \".4..\" +\n \"....\", numbers);\n\n numbers.move(Direction.RIGHT);\n\n ... | {
"fields": [
{
"declarator": "NONE = 0",
"modifier": "public static final",
"original_string": "public static final int NONE = 0;",
"type": "int",
"var_name": "NONE"
},
{
"declarator": "BREAK = -1",
"modifier": "public static final",
"original_string": "pub... | {
"body": "public void move(Direction direction) {\n switch (direction) {\n case RIGHT : merge(this.new _XY()); break;\n case UP : merge(this.new Y_X()); break;\n case LEFT : merge(this.new XY()); break;\n case DOWN : merge(this.new YX()); break;\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_498 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Kata game;",
"type": "Kata",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
"v... | {
"body": "@Test\n public void shouldPlayerSkipFirstTwoLevels_thenAnswer_case2() {\n givenGame(qa(\"question1=answer1\"),\n qa(\"question2=answer2\",\n \"question3=answer3\"),\n qa(\"question4=answer4\",\n \"question5=answer5\"));\n... | {
"fields": [
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
"type": "List<Player>",
"var_name": "players"
},
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n player.checkAnswer();\n }\n }",
"class_method_signature": "Kata.tick()",
"constructor": false,
"full_signature": "@Override public void tick()",
"identifier": "tick",
"invocations": [
"checkAns... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_477 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Hex game;",
"type": "Hex",
"var_name": "game"
},
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
"type": "Dice",
"var... | {
"body": "@Test\n public void shouldDoNothingWhenMoveAtOnePlace() {\n givenFl(\"☼☼☼☼☼☼\" +\n \"☼ ♥ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☻ ☼\" +\n \"☼☼☼☼☼☼\");\n\n // when\n joystick2.act(3, 1);\n joystick... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private List<Wall> walls;",
"type": "List<Wall>",
"var_name": "walls"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n player.tick();\n }\n\n if (isGameOver()) return;\n\n List<Hero> newHeroes = new LinkedList<>();\n for (Player player : players) {\n if (player.getNewHero() != null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_924 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game"... | {
"body": "@Test\n public void testEquals_withPlayer() {\n // given\n Player otherPlayer = new Player(\"other player\", \"other url\", PlayerTest.mockGameType(\"game\"),\n NullPlayerScores.INSTANCE, NullInformation.INSTANCE);\n\n // when then\n assertEquals(false, playerG... | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game"... | {
"body": "@Override\n public boolean equals(Object o) {\n if (o == null) return false;\n if (this == NullPlayerGame.INSTANCE && (o != NullPlayer.INSTANCE && o != NullPlayerGame.INSTANCE)) return false;\n\n if (o instanceof String) {\n return o.equals(roomName);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1078 | {
"fields": [
{
"declarator": "properties",
"modifier": "private",
"original_string": "private ConfigProperties properties;",
"type": "ConfigProperties",
"var_name": "properties"
},
{
"declarator": "registration",
"modifier": "private",
"original_string": "p... | {
"body": "@Test\n public void validateIsNickName() {\n assertTrue(validator.isNickName(\"Стивен Пупкин\"));\n\n assertTrue(validator.isNickName(\"Oleksandr Baglay\"));\n\n assertTrue(validator.isNickName(\"Stiven Pupkin\"));\n\n assertTrue(validator.isNickName(\"FuTuRamA\"));\n\n ... | {
"fields": [
{
"declarator": "CAN_BE_NULL = true",
"modifier": "public static final",
"original_string": "public static final boolean CAN_BE_NULL = true;",
"type": "boolean",
"var_name": "CAN_BE_NULL"
},
{
"declarator": "CANT_BE_NULL = !CAN_BE_NULL",
"modifier": ... | {
"body": "public boolean isNickName(String input) {\n boolean empty = isEmpty(input);\n if (empty || !nickName.matcher(input).matches()) {\n return false;\n }\n\n return true;\n }",
"class_method_signature": "Validator.isNickName(String input)",
"constructor": false,
"... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_709 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private StartAndJump game;",
"type": "StartAndJump",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": ... | {
"body": "@Test\n public void shouldFullGameWithPlatformsAndJumps() {\n givenFl(\"####################\" +\n \" = \" +\n \" = \" +\n \" = \" +\n \" = \" +\n \" = ... | {
"fields": [
{
"declarator": "MAX_PLATFORM_LENGTH = 3",
"modifier": "public static final",
"original_string": "public static final int MAX_PLATFORM_LENGTH = 3;",
"type": "int",
"var_name": "MAX_PLATFORM_LENGTH"
},
{
"declarator": "platformGenerator",
"modifier": ... | {
"body": "@Override\n public void tick() {\n tickCounter++;\n platforms.addAll(platformGenerator.generateRandomPlatforms());\n\n // set player JUMPING status and/or jumpCounter since last IDLE\n for (Player player : players) {\n Hero hero = player.getHero();\n her... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_359 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Loderunner game;",
"type": "Loderunner",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Her... | {
"body": "@Test\n public void shouldDrillLeft() {\n givenFl(\"☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼ ◄ ☼\" +\n \"☼###☼\" +\n \"☼☼☼☼☼\");\n\n hero.act();\n hero.left();\n game.tick();\n\n assertE(\"☼☼☼☼☼\" +\n \"☼ ... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private Point[][] field;",
"type": "Point[][]",
"var_name": "field"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n Set<Player> die = new HashSet<>();\n\n heroesGo();\n die.addAll(getDied());\n\n enemiesGo();\n die.addAll(getDied());\n\n die.addAll(bricksGo());\n\n for (Player player : die) {\n player.event(Events.KILL_HERO... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_135 | {
"fields": [
{
"declarator": "WITH_BREAK = true",
"modifier": "private static final",
"original_string": "private static final boolean WITH_BREAK = true;",
"type": "boolean",
"var_name": "WITH_BREAK"
},
{
"declarator": "WITHOUT_BREAK = false",
"modifier": "privat... | {
"body": "@Test\n public void shouldMoveNumbersWhenUseJoystickLeft() {\n givenFl(\" 2 \" +\n \" \" +\n \" 4 \" +\n \" \");\n\n joystick.left();\n field.tick();\n\n assertE(\"2 \" +\n \" \" +\n \"4 ... | {
"fields": [
{
"declarator": "generator",
"modifier": "private",
"original_string": "private Generator generator;",
"type": "Generator",
"var_name": "generator"
},
{
"declarator": "numbers",
"modifier": "private",
"original_string": "private Numbers numbers... | {
"body": "@Override\n public void tick() {\n if (isGameOver()) {\n return;\n }\n\n if (numbers.isEmpty()) {\n hero().down();\n }\n\n if (hero().getDirection() != null) {\n numbers.move(hero().getDirection());\n\n generateNewNumber();\n... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_47 | {
"fields": [],
"file": "CodingDojo/games/icancode/src/test/java/com/codenjoy/dojo/icancode/model/ICanCodeTest.java",
"identifier": "ICanCodeTest",
"interfaces": "",
"superclass": "extends AbstractGameTest"
} | {
"body": "@Test\n public void shouldLaserFireOn6Ticks() {\n // given\n givenFl(\"╔═════┐\" +\n \"║˃...˅│\" +\n \"║.S...│\" +\n \"║.....│\" +\n \"║.....│\" +\n \"║˄...˂│\" +\n \"└─────┘\");\n\n // when\n ... | {
"fields": [
{
"declarator": "SINGLE = false",
"modifier": "public static final",
"original_string": "public static final boolean SINGLE = false;",
"type": "boolean",
"var_name": "SINGLE"
},
{
"declarator": "MULTIPLE = true",
"modifier": "public static final",
... | {
"body": "@Override\n public void tick() {\n level.getItems(HeroItem.class).stream()\n .map(it -> (HeroItem)it)\n .forEach(HeroItem::tick);\n\n level.getItems(Tickable.class).stream()\n .filter(it -> !(it instanceof HeroItem))\n .filter(it ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_565 | {
"fields": [
{
"declarator": "joystick",
"modifier": "private",
"original_string": "private Joystick joystick;",
"type": "Joystick",
"var_name": "joystick"
}
],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/services/PlayerCommandTest.java",
"identifier":... | {
"body": "@Test\n public void shouldMessageWithNRInParametersCommand() {\n execute(\"message('hel\\nlo w\\nor\\rld')\");\n\n InOrder inOrder = inOrder(joystick);\n inOrder.verify(joystick).message(\"hel\\nlo w\\nor\\rld\");\n }",
"class_method_signature": "PlayerCommandTest.shouldMessage... | {
"fields": [
{
"declarator": "logger = DLoggerFactory.getLogger(PlayerCommand.class)",
"modifier": "private static",
"original_string": "private static Logger logger = DLoggerFactory.getLogger(PlayerCommand.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declara... | {
"body": "public void execute(){\n Matcher matcher = PATTERN.matcher(command);\n while (matcher.find()) {\n String command = matcher.group(0);\n if (command == null) {\n continue;\n }\n command = command.toLowerCase();\n\n try {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_836 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Quadro game;",
"type": "Quadro",
"var_name": "game"
},
{
"declarator": "hero1",
"modifier": "private",
"original_string": "private Hero hero1;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldYellowGoesFirst() {\n givenFl(\" \" +\n \" \" +\n \" \" +\n \" \" +\n \" \" +\n \" \" +\n \" \" +\n \" ... | {
"fields": [
{
"declarator": "TIMEOUT_TICKS = 15",
"modifier": "static final",
"original_string": "static final int TIMEOUT_TICKS = 15;",
"type": "int",
"var_name": "TIMEOUT_TICKS"
},
{
"declarator": "CHIPS_LENGTH_TO_WIN = 4",
"modifier": "private static final",
... | {
"body": "@Override\n public void tick() {\n if (!isGameStarted()) return;\n\n if (gameOver > 0) {\n if (++gameOver > TIMEOUT_TICKS) {\n chips.clear();\n gameOver = 0;\n } else {\n return;\n }\n }\n\n chipMov... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_973 | {
"fields": [
{
"declarator": "VASYA = \"vasya\"",
"modifier": "public static final",
"original_string": "public static final String VASYA = \"vasya\";",
"type": "String",
"var_name": "VASYA"
},
{
"declarator": "VASYA_AI = \"vasya-super-ai\"",
"modifier": "public ... | {
"body": "@Test\n public void shouldRequestControl_fromAllPlayers() {\n // given\n Player vasia = createPlayer(VASYA);\n Player petia = createPlayer(PETYA);\n\n // when\n playerService.tick();\n\n // then\n assertSentToPlayers(vasia, petia);\n assertHostsCap... | {
"fields": [
{
"declarator": "lock = new ReentrantReadWriteLock(true)",
"modifier": "private",
"original_string": "private ReadWriteLock lock = new ReentrantReadWriteLock(true);",
"type": "ReadWriteLock",
"var_name": "lock"
},
{
"declarator": "cacheBoards = new HashMap... | {
"body": "@Override\n public void tick() {\n lock.writeLock().lock();\n try {\n profiler.start(\"PlayerService.tick()\");\n\n actionLogger.log(playerGames);\n autoSaver.tick();\n\n playerGames.tick();\n sendScreenUpdates();\n requestC... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_420 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Loderunner game;",
"type": "Loderunner",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Her... | {
"body": "@Test\n public void shouldEnemyCantMoveWhenFall() {\n givenFl(\"☼☼☼☼☼☼►\" +\n \"☼ » ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼## ##☼\" +\n \"☼☼☼☼☼☼☼\");\n\n enemy.left();\n g... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private Point[][] field;",
"type": "Point[][]",
"var_name": "field"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n Set<Player> die = new HashSet<>();\n\n heroesGo();\n die.addAll(getDied());\n\n enemiesGo();\n die.addAll(getDied());\n\n die.addAll(bricksGo());\n\n for (Player player : die) {\n player.event(Events.KILL_HERO... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1081 | {
"fields": [
{
"declarator": "properties",
"modifier": "private",
"original_string": "private ConfigProperties properties;",
"type": "ConfigProperties",
"var_name": "properties"
},
{
"declarator": "registration",
"modifier": "private",
"original_string": "p... | {
"body": "@Test\n public void validateCheckPlayerInRoom() {\n givenPlayer(\"validPlayerId\", \"validRoomName\");\n givenPlayer(\"otherPlayer\", \"otherRoomName\");\n\n shouldOk(() -> validator.checkPlayerInRoom(\"validPlayerId\", \"validRoomName\"));\n\n shouldError(\"Player id is inva... | {
"fields": [
{
"declarator": "CAN_BE_NULL = true",
"modifier": "public static final",
"original_string": "public static final boolean CAN_BE_NULL = true;",
"type": "boolean",
"var_name": "CAN_BE_NULL"
},
{
"declarator": "CANT_BE_NULL = !CAN_BE_NULL",
"modifier": ... | {
"body": "public void checkPlayerInRoom(String id, String roomName) {\n checkRoomName(roomName, CANT_BE_NULL);\n checkPlayerId(id, CANT_BE_NULL);\n\n if (!playerService.get(id).getRoomName().equals(roomName)) {\n throw new IllegalArgumentException(String.format(\"Player '%s' is not in... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_820 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Spacerace game;",
"type": "Spacerace",
"var_name": "game"
},
{
"declarator": "charger = getBulletCharger()",
"modifier": "private",
"original_string": "private BulletCha... | {
"body": "@Test\n public void shouldBombDestroyedByBulletNew() {\n // given\n givenFl(\"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☺ ☼\");\n\n diceNew(0, 2);\n hero.recharge();... | {
"fields": [
{
"declarator": "NEW_APPEAR_PERIOD = 3",
"modifier": "private static final",
"original_string": "private static final int NEW_APPEAR_PERIOD = 3;",
"type": "int",
"var_name": "NEW_APPEAR_PERIOD"
},
{
"declarator": "MAX_COUNT_BULLET_PACKS = 1",
"modifi... | {
"body": "@Override\n public void tick() {\n explosions.clear();\n createStone();\n createBomb();\n createBulletPack();\n tickHeroes();\n removeHeroDestroyedByBullet();\n tickBullets();\n tickStones();\n tickBombs();\n removeHeroDestroyedByBull... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_573 | {
"fields": [
{
"declarator": "board",
"modifier": "private",
"original_string": "private AbstractBoard board;",
"type": "AbstractBoard",
"var_name": "board"
}
],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/client/AbstractBoardTest.java",
"identifier": ... | {
"body": "@Test\n public void shouldWork_isAt() {\n assertEquals(true, board.isAt(0, 0, Elements.ONE));\n assertEquals(false, board.isAt(1, 1, Elements.ONE));\n assertEquals(false, board.isAt(2, 2, Elements.ONE));\n\n assertEquals(true, board.isAt(1, 1, Elements.TWO, Elements.THREE));\... | {
"fields": [],
"file": "CodingDojo/games/engine/src/main/java/com/codenjoy/dojo/client/AbstractBoard.java",
"identifier": "AbstractBoard",
"interfaces": "",
"methods": [
{
"class_method_signature": "AbstractBoard.valueOf(char ch)",
"constructor": false,
"full_signature": "public abstrac... | {
"body": "public boolean isAt(int x, int y, E element) {\n for (int layer = 0; layer < countLayers(); ++layer) {\n if (isAt(layer, x, y, element)) {\n return true;\n }\n }\n return false;\n }",
"class_method_signature": "AbstractBoard.isAt(int x, int y, ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_123 | {
"fields": [
{
"declarator": "BOARD_SIZE = 9",
"modifier": "private static final",
"original_string": "private static final int BOARD_SIZE = 9;",
"type": "int",
"var_name": "BOARD_SIZE"
},
{
"declarator": "SNAKE_SIZE = 2",
"modifier": "private static final",
... | {
"body": "@Test\n public void shouldTeleport_whenTurnRight() {\n givenBoardWithoutWalls();\n\n asrtBrd(\" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" ╘► \\n\" +\n \" \\n\" ... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private Walls walls;",
"type": "Walls",
"var_name": "walls"
},
{
"declarator": "stone",
"modifier": "private",
"original_string": "private Stone stone;",
"type": "Stone",... | {
"body": "@Override\n public void tick() {\n if (!snake().isAlive()) return;\n\n snake().walk(this);\n }",
"class_method_signature": "Snake.tick()",
"constructor": false,
"full_signature": "@Override public void tick()",
"identifier": "tick",
"invocations": [
"isAlive",
"snake",... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_51 | {
"fields": [],
"file": "CodingDojo/games/icancode/src/test/java/com/codenjoy/dojo/icancode/model/ICanCodeTest.java",
"identifier": "ICanCodeTest",
"interfaces": "",
"superclass": "extends AbstractGameTest"
} | {
"body": "@Test\n public void shouldJumpAtHole_whenNearWall() {\n // given\n givenFl(\"╔══┐\" +\n \"║SO│\" +\n \"║..│\" +\n \"└──┘\");\n\n // when\n hero.right();\n hero.jump();\n game.tick();\n\n // then\n assert... | {
"fields": [
{
"declarator": "SINGLE = false",
"modifier": "public static final",
"original_string": "public static final boolean SINGLE = false;",
"type": "boolean",
"var_name": "SINGLE"
},
{
"declarator": "MULTIPLE = true",
"modifier": "public static final",
... | {
"body": "@Override\n public void tick() {\n level.getItems(HeroItem.class).stream()\n .map(it -> (HeroItem)it)\n .forEach(HeroItem::tick);\n\n level.getItems(Tickable.class).stream()\n .filter(it -> !(it instanceof HeroItem))\n .filter(it ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_436 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Loderunner game;",
"type": "Loderunner",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Her... | {
"body": "@Test\n public void shouldEnemyCantJumpThroughWall() {\n givenFl(\"☼☼☼☼☼►\" +\n \"☼ » ☼\" +\n \"☼ ~ ☼\" +\n \"☼☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼☼☼☼☼☼\");\n\n game.tick();\n\n assertE(\"☼☼☼☼☼►\" +\n ... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private Point[][] field;",
"type": "Point[][]",
"var_name": "field"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n Set<Player> die = new HashSet<>();\n\n heroesGo();\n die.addAll(getDied());\n\n enemiesGo();\n die.addAll(getDied());\n\n die.addAll(bricksGo());\n\n for (Player player : die) {\n player.event(Events.KILL_HERO... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_965 | {
"fields": [
{
"declarator": "HASH = \"someHash\"",
"modifier": "public static final",
"original_string": "public static final String HASH = \"someHash\";",
"type": "String",
"var_name": "HASH"
},
{
"declarator": "CODE_FOR_ID_AND_PASS = \"4486751343675417965\"",
... | {
"body": "@Test\n public void shouldGetEmailById_notExistent() {\n // when \n String email = service.getEmailById(\"bad_id\");\n\n // then\n assertEquals(null, email);\n }",
"class_method_signature": "RegistrationTest.shouldGetEmailById_notExistent()",
"constructor": false,
"f... | {
"fields": [
{
"declarator": "ADMIN_USER_ID = 0",
"modifier": "public static final",
"original_string": "public static final int ADMIN_USER_ID = 0;",
"type": "int",
"var_name": "ADMIN_USER_ID"
},
{
"declarator": "pool",
"modifier": "private",
"original_stri... | {
"body": "public String getEmailById(String id) {\n return pool.select(\"SELECT email FROM users WHERE id = ?;\",\n new Object[]{id},\n rs -> rs.next() ? rs.getString(\"email\") : null\n );\n }",
"class_method_signature": "Registration.getEmailById(String id)",
"con... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1039 | {
"fields": [
{
"declarator": "NEVER = 0",
"modifier": "private static final",
"original_string": "private static final int NEVER = 0;",
"type": "int",
"var_name": "NEVER"
},
{
"declarator": "ONCE = 1",
"modifier": "public static final",
"original_string": "... | {
"body": "@Test\n public void testChangeRoom_twoLeftOneRemained() {\n // given\n MultiplayerType type = MultiplayerType.MULTIPLE;\n createPlayer(\"player1\", \"room\", \"game\", type);\n createPlayer(\"player2\", \"room\", \"game\", type);\n createPlayer(\"player3\", \"room\", \... | {
"fields": [
{
"declarator": "ALL = true",
"modifier": "public static final",
"original_string": "public static final boolean ALL = true;",
"type": "boolean",
"var_name": "ALL"
},
{
"declarator": "ACTIVE = !ALL",
"modifier": "public static final",
"original... | {
"body": "public void changeRoom(String playerId, String roomName) {\n if (roomName == null) {\n return;\n }\n PlayerGame playerGame = get(playerId);\n JSONObject save = playerGame.getGame().getSave();\n Game game = playerGame.getGame();\n reload(game, roomName, s... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_748 | {
"fields": [
{
"declarator": "board",
"modifier": "private",
"original_string": "private Board board;",
"type": "Board",
"var_name": "board"
}
],
"file": "CodingDojo/games/expansion/src/test/java/com/codenjoy/dojo/expansion/client/BoardTest.java",
"identifier": "BoardTest"... | {
"body": "@Test\n public void shouldGetMyAvailable() {\n assertEquals(10, board.getForcesAvailable());\n }",
"class_method_signature": "BoardTest.shouldGetMyAvailable()",
"constructor": false,
"full_signature": "@Test public void shouldGetMyAvailable()",
"identifier": "shouldGetMyAvailable",
"... | {
"fields": [
{
"declarator": "COUNT_NUMBERS = 3",
"modifier": "private final",
"original_string": "private final int COUNT_NUMBERS = 3;",
"type": "int",
"var_name": "COUNT_NUMBERS"
}
],
"file": "CodingDojo/games/expansion/src/main/java/com/codenjoy/dojo/expansion/client/Boar... | {
"body": "public int getForcesAvailable() {\n return source.getInt(\"available\");\n }",
"class_method_signature": "Board.getForcesAvailable()",
"constructor": false,
"full_signature": "public int getForcesAvailable()",
"identifier": "getForcesAvailable",
"invocations": [
"getInt"
],
"mod... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_318 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldOtherTankDoNotMove_whenRiverToWay_goRightOrUpOrLeftOrDown() {\n givenFl(\"☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ▓ ☼\\n\" +\n \"☼ ▓▲▓ ☼\\n\" +\n \"☼ ▓ ☼\\n\" +\n \"☼ ˄☼\\n\" +\n ... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_174 | {
"fields": [
{
"declarator": "EMPTY = new LinkedList<Number>()",
"modifier": "private static final",
"original_string": "private static final List<Number> EMPTY = new LinkedList<Number>();",
"type": "List<Number>",
"var_name": "EMPTY"
}
],
"file": "CodingDojo/games/a2048/src... | {
"body": "@Test\n public void shouldCanGo_horizontal() {\n Numbers numbers = new Numbers(\n Arrays.asList(\n new Number(4, pt(0, 0)),\n new Number(2, pt(0, 1)),\n new Number(4, pt(1, 0)),\n new Number... | {
"fields": [
{
"declarator": "NONE = 0",
"modifier": "public static final",
"original_string": "public static final int NONE = 0;",
"type": "int",
"var_name": "NONE"
},
{
"declarator": "BREAK = -1",
"modifier": "public static final",
"original_string": "pub... | {
"body": "public boolean canGo(Mirror data) {\n for (int x = 0; x < size; x++) {\n for (int y = 0; y < size; y++) {\n if (data.get(x, y) == NONE) {\n return true;\n }\n }\n\n for (int y1 = 0; y1 < size - 1; y1++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_524 | {
"fields": [
{
"declarator": "json",
"modifier": "private",
"original_string": "private JSONObject json;",
"type": "JSONObject",
"var_name": "json"
}
],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/services/multiplayer/LevelProgressTest.java",
"identifi... | {
"body": "@Test\n public void constructFromInts_valid_totalCanBeEqualsWithCurrent_thisIsLasMultipleLevelForTraining() {\n // given\n int total = 2;\n int current = total;\n int passed = 1;\n\n // when\n LevelProgress progress = new LevelProgress(total, current, passed);\n... | {
"fields": [
{
"declarator": "total",
"modifier": "protected",
"original_string": "protected int total;",
"type": "int",
"var_name": "total"
},
{
"declarator": "current",
"modifier": "protected",
"original_string": "protected int current;",
"type": "i... | {
"body": "@Override\n public String toString() {\n return JsonUtils.toStringSorted(this).replace('\"', '\\'');\n }",
"class_method_signature": "LevelProgress.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_877 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Football game;",
"type": "Football",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void gameStartsFromPlayerWithBallState() {\n givenFl(\"☼☼☼☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼☻ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼ ☼\" +\n \"☼☼☼... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private List<Wall> walls;",
"type": "List<Wall>",
"var_name": "walls"
},
{
"declarator": "topGoals",
"modifier": "private",
"original_string": "private List<Goal> topGoals;",
... | {
"body": "@Override\n public void tick() {\n for (Ball ball : balls) {\n for (Goal goal : topGoals) {\n if (goal.itsMe(ball)) {\n for (Player player : players) {\n player.event(Events.TOP_GOAL);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_932 | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game"... | {
"body": "@Test\n public void testToString() {\n // when then\n assertEquals(String.format(\"PlayerGame[player=player, roomName=room, game=%s]\",\n game.getClass().getSimpleName()),\n playerGame.toString());\n }",
"class_method_signature": "PlayerGameTest.testToStr... | {
"fields": [
{
"declarator": "player",
"modifier": "private",
"original_string": "private Player player;",
"type": "Player",
"var_name": "player"
},
{
"declarator": "game",
"modifier": "private",
"original_string": "private Game game;",
"type": "Game"... | {
"body": "@Override\n public String toString() {\n return String.format(\"PlayerGame[player=%s, roomName=%s, game=%s]\",\n player,\n roomName,\n game.getClass().getSimpleName());\n }",
"class_method_signature": "PlayerGame.toString()",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_898 | {
"fields": [],
"file": "CodingDojo/games/lunolet/src/test/java/com/codenjoy/dojo/lunolet/model/SimulatorTest.java",
"identifier": "SimulatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void takeOffAndLanding1_HeavyVessel_VerticalFlight() {\n Simulator sut = new Simulator();\n sut.DryMass = 2150;\n sut.Status.FuelMass = 400;\n sut.Status.State = VesselState.START;\n\n sut.simulate(0, 20, 10);\n assertVesselStatus(sut.Status, 12.6... | {
"fields": [
{
"declarator": "Eps = 1e-5",
"modifier": "",
"original_string": "double Eps = 1e-5;",
"type": "double",
"var_name": "Eps"
},
{
"declarator": "GravityAccel = 1.62",
"modifier": "",
"original_string": "double GravityAccel = 1.62;",
"type":... | {
"body": "public void simulate(double angle, double mass, double duration) {\n if (mass < 0.0)\n throw new IllegalArgumentException(\"mass should be positive number or zero.\");\n if (duration <= 0.0)\n throw new IllegalArgumentException(\"duration should be positive number.\");\n... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_461 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Hex game;",
"type": "Hex",
"var_name": "game"
},
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
"type": "Dice",
"var... | {
"body": "@Test\n public void shouldKillWhenPlayerMoveTowardsStanding() {\n // given\n givenFl(\"☼☼☼☼☼\" +\n \"☼ ♥☼\" +\n \"☼ ☼\" +\n \"☼☻ ☼\" +\n \"☼☼☼☼☼\");\n\n joystick2.act(3, 1);\n joystick2.down();\n game.tick... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private List<Wall> walls;",
"type": "List<Wall>",
"var_name": "walls"
},
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n player.tick();\n }\n\n if (isGameOver()) return;\n\n List<Hero> newHeroes = new LinkedList<>();\n for (Player player : players) {\n if (player.getNewHero() != null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1032 | {
"fields": [
{
"declarator": "NEVER = 0",
"modifier": "private static final",
"original_string": "private static final int NEVER = 0;",
"type": "int",
"var_name": "NEVER"
},
{
"declarator": "ONCE = 1",
"modifier": "public static final",
"original_string": "... | {
"body": "@Test\n public void testGetBoardAsString_trainingMultiplayerType_caseString() {\n // given\n MultiplayerType type = MultiplayerType.TRAINING.apply(3);\n\n Player player = createPlayer(\"player\", \"room\", \"game\", type, null,\n \"board-data\");\n\n when(field... | {
"fields": [
{
"declarator": "ALL = true",
"modifier": "public static final",
"original_string": "public static final boolean ALL = true;",
"type": "boolean",
"var_name": "ALL"
},
{
"declarator": "ACTIVE = !ALL",
"modifier": "public static final",
"original... | {
"body": "public PlayerGame get(String id) {\n return all.stream()\n .filter(pg -> pg.getPlayer().getId().equals(id))\n .findFirst()\n .orElse(NullPlayerGame.INSTANCE);\n }",
"class_method_signature": "PlayerGames.get(String id)",
"constructor": false,
"fu... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_313 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldOtherTankMoveLeftThenUpThenDown_onIce() {\n givenFl(\"☼☼☼☼☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ▼ ☼\\n\" +\n \"☼ █ ☼\\n\" +\n ... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "@Override\n public void tick() {\n removeDeadTanks();\n\n aiGen.dropAll();\n\n List<Tank> tanks = allTanks();\n\n for (Tank tank : tanks) {\n tank.tick();\n }\n\n for (Bullet bullet : bullets()) {\n if (bullet.destroyed()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_743 | {
"fields": [],
"file": "CodingDojo/games/expansion/src/test/java/com/codenjoy/dojo/expansion/model/ForcesMovesTest.java",
"identifier": "ForcesMovesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParse_withoutDirection() {\n JSONObject json = new JSONObject(\"{region:{x:-1, y:-5}, count:2}\");\n\n // when\n ForcesMoves forces = new ForcesMoves(json);\n\n // then\n assertEquals(2, forces.getCount());\n assertEquals(QDirection.NONE.... | {
"fields": [
{
"declarator": "direction",
"modifier": "private",
"original_string": "private QDirection direction;",
"type": "QDirection",
"var_name": "direction"
}
],
"file": "CodingDojo/games/expansion/src/main/java/com/codenjoy/dojo/expansion/model/ForcesMoves.java",
"i... | {
"body": "public String getDirection() {\n return direction.toString();\n }",
"class_method_signature": "ForcesMoves.getDirection()",
"constructor": false,
"full_signature": "public String getDirection()",
"identifier": "getDirection",
"invocations": [
"toString"
],
"modifiers": "public",... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_256 | {
"fields": [
{
"declarator": "dice = mock(Dice.class)",
"modifier": "protected",
"original_string": "protected Dice dice = mock(Dice.class);",
"type": "Dice",
"var_name": "dice"
},
{
"declarator": "ticksPerBullets",
"modifier": "public",
"original_string": ... | {
"body": "@Test\n public void shouldBeTankOnFieldWhenGameCreated() {\n givenFl(\"☼☼☼☼☼☼☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼ ☼\\n\" +\n \"☼▲ ☼\\n\" +\n \"☼☼☼☼☼☼☼\\n\");\n\n ... | {
"fields": [
{
"declarator": "size",
"modifier": "private",
"original_string": "private int size;",
"type": "int",
"var_name": "size"
},
{
"declarator": "prizeGen",
"modifier": "private",
"original_string": "private PrizeGenerator prizeGen;",
"type": ... | {
"body": "public List<Tank> allTanks() {\n List<Tank> result = new LinkedList<>(ais);\n for (Player player : players) {\n// if (player.getTank().isAlive()) { // TODO разремарить с тестом\n result.add(player.getHero());\n// }\n }\n return result;\n }... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_606 | {
"fields": [
{
"declarator": "INITIAL =\n \" WWW \" +\n \" WWW \" +\n \" WWW \" +\n \"BBBOOOGGGRRR\" +\n \"BBBOOOGGGRRR\" +\n \"BBBOOOGGGRRR\" +\n \" YYY \" +\n \" YYY \" +\n ... | {
"body": "@Test\n public void shouldGivenR2() {\n givenFl(\"R2\");\n\n assertE(\" WWY \" +\n \" WWY \" +\n \" WWY \" +\n \"BBBOORGGGORR\" +\n \"BBBOORGGGORR\" +\n \"BBBOORGGGORR\" +\n \" ... | {
"fields": [
{
"declarator": "cube",
"modifier": "private",
"original_string": "private Cube cube;",
"type": "Cube",
"var_name": "cube"
},
{
"declarator": "cells",
"modifier": "private",
"original_string": "private CellsAdapter cells;",
"type": "Cells... | {
"body": "@Override\n public void tick() {\n if (gameOver) return;\n String command = player.getHero().pullCommand();\n if (command == null) return;\n\n cube.doCommand(command);\n\n checkIsWin();\n }",
"class_method_signature": "RubicsCube.tick()",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_485 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Kata game;",
"type": "Kata",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
"v... | {
"body": "@Test\n public void should_invalid_valid() {\n givenQA(\"question1=answer1\",\n \"question2=answer2\",\n \"question3=answer3\");\n\n // when\n hero.message(\"['wrong-answer']\");\n game.tick();\n\n hero.message(\"['answer1']\");\n g... | {
"fields": [
{
"declarator": "players",
"modifier": "private",
"original_string": "private List<Player> players;",
"type": "List<Player>",
"var_name": "players"
},
{
"declarator": "dice",
"modifier": "private",
"original_string": "private Dice dice;",
... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n player.checkAnswer();\n }\n }",
"class_method_signature": "Kata.tick()",
"constructor": false,
"full_signature": "@Override public void tick()",
"identifier": "tick",
"invocations": [
"checkAns... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_893 | {
"fields": [],
"file": "CodingDojo/games/lunolet/src/test/java/com/codenjoy/dojo/lunolet/model/SimulatorTest.java",
"identifier": "SimulatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void landing_VerticalFreeFallFrom20cm_LandElevatedMinus10m() {\n Simulator sut = new Simulator();\n sut.Status.Y = -9.8;\n sut.Status.State = VesselState.FLIGHT;\n\n sut.Relief.clear();\n sut.Relief.add(new Point2D.Double(-50, -10));\n sut.Relief.... | {
"fields": [
{
"declarator": "Eps = 1e-5",
"modifier": "",
"original_string": "double Eps = 1e-5;",
"type": "double",
"var_name": "Eps"
},
{
"declarator": "GravityAccel = 1.62",
"modifier": "",
"original_string": "double GravityAccel = 1.62;",
"type":... | {
"body": "public void simulate(double angle, double mass, double duration) {\n if (mass < 0.0)\n throw new IllegalArgumentException(\"mass should be positive number or zero.\");\n if (duration <= 0.0)\n throw new IllegalArgumentException(\"duration should be positive number.\");\n... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_939 | {
"fields": [
{
"declarator": "registration",
"modifier": "private",
"original_string": "private Registration registration;",
"type": "Registration",
"var_name": "registration"
},
{
"declarator": "saveService",
"modifier": "private",
"original_string": "priv... | {
"body": "@Test\n public void shouldGetAllActivePlayersWithSavedGamesDataSortedByName() {\n // given\n Player activeSavedPlayer = createPlayer(\"activeSaved\"); // check sorting order (activeSaved > active)\n Player activePlayer = createPlayer(\"active\");\n scores(activeSavedPlayer, 1... | {
"fields": [
{
"declarator": "DEFAULT_CALLBACK_URL = \"127.0.0.1\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CALLBACK_URL = \"127.0.0.1\";",
"type": "String",
"var_name": "DEFAULT_CALLBACK_URL"
},
{
"declarator": "saver... | {
"body": "@Override\n public List<PlayerInfo> getSaves() {\n Map<String, PlayerInfo> map = new HashMap<>();\n for (Player player : players.getAll()) {\n PlayerInfo info = new PlayerInfo(player);\n setDataFromRegistration(info, player.getId());\n setSaveFromField(info... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_190 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Sample game;",
"type": "Sample",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldDieOnBomb() {\n shouldMakeBomb();\n\n assertTrue(hero.isAlive());\n\n hero.up();\n game.tick();\n verify(listener).event(Events.LOOSE);\n\n assertE(\"☼☼☼☼☼\" +\n \"☼ ☼\" +\n \"☼ X ☼\" +\n \... | {
"fields": [
{
"declarator": "walls",
"modifier": "private",
"original_string": "private List<Wall> walls;",
"type": "List<Wall>",
"var_name": "walls"
},
{
"declarator": "gold",
"modifier": "private",
"original_string": "private List<Gold> gold;",
"ty... | {
"body": "@Override\n public void tick() {\n for (Player player : players) {\n Hero hero = player.getHero();\n\n hero.tick();\n\n if (gold.contains(hero)) {\n gold.remove(hero);\n player.event(Events.WIN);\n\n Point pos = getFree... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_714 | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private IField field;",
"type": "IField",
"var_name": "field"
},
{
"declarator": "printer",
"modifier": "private",
"original_string": "private Printer<PrinterData> printer;",
... | {
"body": "@Test\n public void shouldCanMoveJustIncreased() {\n // given\n givenFl(\"╔═══┐\" +\n \"║...│\" +\n \"║.1.│\" +\n \"║...│\" +\n \"└───┘\");\n\n assertF(\"-=#-=#-=#-=#-=#\\n\" +\n \"-=#-=#-=#-=#-=#\\n\" +\n ... | {
"fields": [
{
"declarator": "WIN_MULTIPLE = Events.WIN(data.winScore())",
"modifier": "public static final",
"original_string": "public static final Events WIN_MULTIPLE = Events.WIN(data.winScore());",
"type": "Events",
"var_name": "WIN_MULTIPLE"
},
{
"declarator": "D... | {
"body": "@Override\n public void tick() {\n if (logger.isDebugEnabled()) {\n logger.debug(\"Expansion {} started tick\", lg.id());\n }\n\n ticker.tick();\n\n if (isWaitingOthers()) return;\n\n roundTicks++;\n\n if (logger.isDebugEnabled()) {\n logge... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_344 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Quake2D game;",
"type": "Quake2D",
"var_name": "game"
},
{
"declarator": "hero",
"modifier": "private",
"original_string": "private Hero hero;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldStopWhenWallUp() {\n givenFl(\"☼☼☼☼☼\" +\n \"☼ ☼ ☼\" +\n \"☼ ☺ ☼\" +\n \"☼ ☼\" +\n \"☼☼☼☼☼\");\n\n hero.up();\n game.tick();\n\n assertE(\"☼☼☼☼☼\" +\n \"☼ ☼ ☼\" +\n ... | {
"fields": [
{
"declarator": "IS_DEAD = 1",
"modifier": "public static final",
"original_string": "public static final int IS_DEAD = 1;",
"type": "int",
"var_name": "IS_DEAD"
},
{
"declarator": "IS_ALIVE = 0",
"modifier": "public static final",
"original_st... | {
"body": "@Override\n public void tick() {\n// robots.addAll(robotsNew);\n// robotsNew.clear();\n\n takeAbility();\n checkBulletDirection();\n checkLifeCycleHero();\n// for (Robot robot : robots) {\n// robot.tick();\n// }\n\n if (counterOfAbility ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_1065 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private RegistrationValidator validator;",
"type": "RegistrationValidator",
"var_name": "validator"
},
{
"declarator": "registration",
"modifier":... | {
"body": "@Test\n public void shouldValidateGameName() {\n // given\n String invalidGameName = \"invalidGame\";\n when(commonValidator.isGameName(invalidGameName, Validator.CANT_BE_NULL)).thenReturn(false);\n player.setGameName(invalidGameName);\n\n // when\n validator.va... | {
"fields": [
{
"declarator": "nicknameAllowed",
"modifier": "@Value(\"${registration.nickname.allowed}\")\n private",
"original_string": "@Value(\"${registration.nickname.allowed}\")\n private boolean nicknameAllowed;",
"type": "boolean",
"var_name": "nicknameAllowed"
},
... | {
"body": "@Override\n public void validate(Object target, Errors errors) {\n if (target == null) {\n return;\n }\n\n Player player = (Player) target;\n\n String name = player.getReadableName();\n\n if (!validateNicknameStructure(name)) {\n errors.rejectValu... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_651 | {
"fields": [
{
"declarator": "game",
"modifier": "private",
"original_string": "private Reversi game;",
"type": "Reversi",
"var_name": "game"
},
{
"declarator": "hero1",
"modifier": "private",
"original_string": "private Hero hero1;",
"type": "Hero",
... | {
"body": "@Test\n public void shouldSkipTurn_ifNoWay_white_afterBlack() {\n givenFl(\" xOx \" +\n \" OO \" +\n \" \" +\n \" \" +\n \" \" +\n \" \" +\n \" \" +\n ... | {
"fields": [
{
"declarator": "flipper",
"modifier": "private",
"original_string": "private Flipper flipper;",
"type": "Flipper",
"var_name": "flipper"
},
{
"declarator": "chips",
"modifier": "private",
"original_string": "private List<Chip> chips;",
"... | {
"body": "@Override\n public void tick() {\n if (isGameOver()) {\n resetField(level);\n return;\n }\n\n getHeroes().forEach(Hero::tick);\n\n if (stop()) {\n return;\n }\n\n if (isGameOver()) {\n whoWin();\n }\n nex... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_201 | {
"fields": [],
"file": "CodingDojo/games/tetris/src/test/java/com/codenjoy/dojo/tetris/model/GlassEventTest.java",
"identifier": "GlassEventTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotEqualsEventsWhenDifferentEvents() {\n GlassEvent event = new GlassEvent(LINES_REMOVED, 4);\n\n assertFalse(event.equals(new GlassEvent(TOTAL_LINES_REMOVED, 4)));\n }",
"class_method_signature": "GlassEventTest.shouldNotEqualsEventsWhenDifferentEvents()",
... | {
"fields": [
{
"declarator": "type",
"modifier": "private",
"original_string": "private Type type;",
"type": "Type",
"var_name": "type"
},
{
"declarator": "value",
"modifier": "private",
"original_string": "private T value;",
"type": "T",
"var_n... | {
"body": "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n GlassEvent that = (GlassEvent) o;\n\n if (type != that.type) return false;\n\n if (value == null || that.value == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_981 | {
"fields": [
{
"declarator": "VASYA = \"vasya\"",
"modifier": "public static final",
"original_string": "public static final String VASYA = \"vasya\";",
"type": "String",
"var_name": "VASYA"
},
{
"declarator": "VASYA_AI = \"vasya-super-ai\"",
"modifier": "public ... | {
"body": "@Test\n public void shouldRemoveAll() {\n // given\n createPlayer(VASYA);\n createPlayer(PETYA);\n\n // when\n playerService.removeAll();\n\n // then\n assertPlayers(\"[]\");\n }",
"class_method_signature": "PlayerServiceImplTest.shouldRemoveAll()",
... | {
"fields": [
{
"declarator": "lock = new ReentrantReadWriteLock(true)",
"modifier": "private",
"original_string": "private ReadWriteLock lock = new ReentrantReadWriteLock(true);",
"type": "ReadWriteLock",
"var_name": "lock"
},
{
"declarator": "cacheBoards = new HashMap... | {
"body": "@Override\n public void removeAll() {\n lock.writeLock().lock();\n try {\n playerGames.clear();\n } finally {\n lock.writeLock().unlock();\n }\n }",
"class_method_signature": "PlayerServiceImpl.removeAll()",
"constructor": false,
"full_signature... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_128 | {
"fields": [
{
"declarator": "scores",
"modifier": "private",
"original_string": "private PlayerScores scores;",
"type": "PlayerScores",
"var_name": "scores"
}
],
"file": "CodingDojo/games/a2048/src/test/java/com/codenjoy/dojo/a2048/services/ScoresTest.java",
"identifier":... | {
"body": "@Test\n public void shouldCollectScores() {\n scores = new Scores(0);\n\n sum(10);\n sum(20);\n sum(30);\n\n assertEquals(30, scores.getScore());\n }",
"class_method_signature": "ScoresTest.shouldCollectScores()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "score",
"modifier": "private volatile",
"original_string": "private volatile int score;",
"type": "int",
"var_name": "score"
}
],
"file": "CodingDojo/games/a2048/src/main/java/com/codenjoy/dojo/a2048/services/Scores.java",
"identifier": "Score... | {
"body": "@Override\n public Integer getScore() {\n return score;\n }",
"class_method_signature": "Scores.getScore()",
"constructor": false,
"full_signature": "@Override public Integer getScore()",
"identifier": "getScore",
"invocations": [],
"modifiers": "@Override public",
"parameters": ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
17612803_578 | {
"fields": [
{
"declarator": "board",
"modifier": "private",
"original_string": "private AbstractBoard board;",
"type": "AbstractBoard",
"var_name": "board"
}
],
"file": "CodingDojo/games/engine/src/test/java/com/codenjoy/dojo/client/AbstractBoardTest.java",
"identifier": ... | {
"body": "@Test\n public void getBoardAsString() {\n assertEquals(\n \"1111\\n\" +\n \"1221\\n\" +\n \"1331\\n\" +\n \"1111\\n\", board.boardAsString());\n }",
"class_method_signature": "AbstractBoardTest.getBoardAsString()",
"constructor":... | {
"fields": [],
"file": "CodingDojo/games/engine/src/main/java/com/codenjoy/dojo/client/AbstractBoard.java",
"identifier": "AbstractBoard",
"interfaces": "",
"methods": [
{
"class_method_signature": "AbstractBoard.valueOf(char ch)",
"constructor": false,
"full_signature": "public abstrac... | {
"body": "public String boardAsString() {\n StringBuffer result = new StringBuffer();\n for (int layer = 0; layer < countLayers(); ++layer) {\n if (layer > 0) {\n result.append('\\n');\n }\n result.append(boardAsString(layer));\n }\n return ... | {
"created": null,
"fork": null,
"fork_count": 151,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17612803,
"size": 131996,
"stargazer_count": 59,
"stars": null,
"updates": null,
"url": "https://github.com/codenjoyme/codenjoy"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.