├── .gitignore ├── EMAILS.md ├── README.md ├── RELEASE_JAVA.md ├── RELEASE_PYTHON.md ├── backend ├── Dockerfile ├── README.md ├── __init__.py ├── api │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── email_helpers.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20190811_1452.py │ │ ├── 0003_auto_20191024_0426.py │ │ ├── 0004_auto_20191103_1312.py │ │ ├── 0005_auto_20191103_1344.py │ │ ├── 0006_auto_20191109_1644.py │ │ ├── 0007_league_game_released.py │ │ ├── 0008_auto_20191110_0252.py │ │ ├── 0009_auto_20191215_2044.py │ │ ├── 0010_team_score.py │ │ ├── 0011_auto_20200110_0821.py │ │ ├── 0012_scrimmage_tournament_id.py │ │ ├── 0013_auto_20200118_2249.py │ │ ├── 0014_auto_20200119_0609.py │ │ ├── 0015_auto_20200122_0135.py │ │ ├── 0016_auto_20200122_0201.py │ │ ├── 0017_auto_20200416_0448.py │ │ ├── 0018_auto_20200416_2354.py │ │ ├── 0019_scrimmage_winscore.py │ │ ├── 0020_scrimmage_losescore.py │ │ ├── 0021_auto_20210104_0550.py │ │ ├── 0022_auto_20210104_0807.py │ │ ├── 0023_auto_20210104_0810.py │ │ ├── 0024_scrimmage_map_ids.py │ │ ├── 0025_auto_20210104_0921.py │ │ ├── 0026_auto_20210105_0702.py │ │ ├── 0027_auto_20210106_0308.py │ │ ├── 0028_auto_20210107_0126.py │ │ ├── 0029_auto_20210107_0137.py │ │ └── __init__.py │ ├── models.py │ ├── permissions.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── backend_script.py ├── dev_settings.py ├── docs │ ├── ELIGIBILITY.md │ ├── SETUP.md │ └── cors.json ├── manage.py ├── requirements.txt ├── resumes │ ├── download.py │ ├── notes.txt │ └── sql.txt ├── settings.py ├── templates │ ├── base.html │ ├── email │ │ ├── password_reset.html │ │ └── verification.html │ └── view.html ├── tests.py ├── tournaments │ ├── README.md │ ├── dev_settings_sensitive.py │ ├── tournament.sql │ └── update_challonge.py ├── urls.py ├── uwsgi-dev.ini ├── uwsgi.ini └── wsgi.py ├── build.gradle ├── client ├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── playback │ ├── README.md │ ├── package-lock.json │ ├── package.json │ └── src │ │ ├── game.ts │ │ ├── gameworld.ts │ │ ├── gen │ │ ├── create.ts │ │ └── tsconfig.json │ │ ├── index.ts │ │ ├── legacy │ │ ├── bench │ │ │ ├── run.ts │ │ │ └── runTimeline.ts │ │ ├── simulator.ts │ │ └── test │ │ │ ├── game.ts │ │ │ └── soa.ts │ │ ├── match.ts │ │ ├── metadata.ts │ │ ├── soa.ts │ │ └── tsconfig.json └── visualizer │ ├── README.md │ ├── build │ └── icon.png │ ├── electron-main.js │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app.ts │ ├── config.ts │ ├── constants.ts │ ├── cow.ts │ ├── gamearea │ │ ├── fps.ts │ │ ├── gamearea.ts │ │ ├── index.ts │ │ ├── nextstep.ts │ │ └── renderer.ts │ ├── imageloader.ts │ ├── main │ │ ├── controls.ts │ │ ├── electron-modules.ts │ │ ├── looper.ts │ │ ├── scaffold.ts │ │ ├── sidebar.ts │ │ ├── splash.ts │ │ ├── tournament.ts │ │ ├── tournament_new.ts │ │ └── websocket.ts │ ├── mapeditor │ │ ├── action │ │ │ ├── generator.ts │ │ │ ├── renderer.ts │ │ │ └── validator.ts │ │ ├── form.ts │ │ ├── forms │ │ │ ├── header.ts │ │ │ ├── robots.ts │ │ │ ├── symmetry.ts │ │ │ └── tiles.ts │ │ ├── index.ts │ │ └── mapeditor.ts │ ├── profiler.ts │ ├── runner.ts │ ├── sidebar │ │ ├── console.ts │ │ ├── index.ts │ │ ├── mapfilter.ts │ │ ├── matchqueue.ts │ │ ├── matchrunner.ts │ │ ├── profiler.ts │ │ └── stats.ts │ └── static │ │ ├── css │ │ ├── style.css │ │ └── tournament.css │ │ └── img │ │ ├── controls │ │ ├── go-end.png │ │ ├── go-next.png │ │ ├── go-previous.png │ │ ├── green-next.png │ │ ├── green-previous.png │ │ ├── playback-pause.png │ │ ├── playback-start.png │ │ ├── playback-stop.png │ │ ├── reverse.png │ │ ├── skip-backward.png │ │ ├── skip-forward.png │ │ └── upload.png │ │ ├── effects │ │ ├── camouflage │ │ │ ├── camo_blue.png │ │ │ └── camo_red.png │ │ ├── death │ │ │ └── death_empty.png │ │ ├── embezzle │ │ │ ├── embezzle.gif │ │ │ ├── embezzle_blue.gif │ │ │ ├── embezzle_red.gif │ │ │ ├── slanderer_embezzle_blue_1.png │ │ │ ├── slanderer_embezzle_blue_2.png │ │ │ ├── slanderer_embezzle_empty_1.png │ │ │ ├── slanderer_embezzle_empty_2.png │ │ │ ├── slanderer_embezzle_red_1.png │ │ │ └── slanderer_embezzle_red_2.png │ │ ├── empower │ │ │ ├── empower.gif │ │ │ ├── empower_blue.gif │ │ │ ├── empower_red.gif │ │ │ ├── polit_empower_blue_1.png │ │ │ ├── polit_empower_blue_2.png │ │ │ ├── polit_empower_empty_1.png │ │ │ ├── polit_empower_empty_2.png │ │ │ ├── polit_empower_red_1.png │ │ │ └── polit_empower_red_2.png │ │ └── expose │ │ │ ├── expose_blue.png │ │ │ ├── expose_empty.png │ │ │ ├── expose_empty_small.png │ │ │ └── expose_red.png │ │ ├── legacy │ │ └── ~2020 │ │ │ ├── bullets │ │ │ ├── bullet_fast.png │ │ │ ├── bullet_medium.png │ │ │ └── bullet_slow.png │ │ │ ├── controls │ │ │ ├── go-next.png │ │ │ ├── go-previous.png │ │ │ ├── playback-pause.png │ │ │ ├── playback-start.png │ │ │ ├── playback-stop.png │ │ │ ├── seek-backward.png │ │ │ ├── seek-forward.png │ │ │ ├── skip-backward.png │ │ │ ├── skip-forward.png │ │ │ └── upload.png │ │ │ ├── map │ │ │ ├── full_health_tree.png │ │ │ ├── low_health_tree.png │ │ │ ├── sapling.png │ │ │ ├── tiled_1.jpg │ │ │ ├── tree_bullets.png │ │ │ └── tree_robots.png │ │ │ ├── soup.png │ │ │ ├── sprites │ │ │ ├── Cow.png │ │ │ ├── Drone_blue.png │ │ │ ├── Drone_blue_carry.png │ │ │ ├── Drone_red.png │ │ │ ├── Drone_red_carry.png │ │ │ ├── Fulfillment_blue.png │ │ │ ├── Fulfillment_red.png │ │ │ ├── HQ_blue.png │ │ │ ├── HQ_red.png │ │ │ ├── Landscaper_blue.png │ │ │ ├── Landscaper_red.png │ │ │ ├── Miner_blue.png │ │ │ ├── Miner_red.png │ │ │ ├── Net_gun_blue.png │ │ │ ├── Net_gun_red.png │ │ │ ├── Refinery_blue.png │ │ │ ├── Refinery_red.png │ │ │ ├── SOUPER_blue.png │ │ │ ├── SOUPER_red.png │ │ │ ├── Vaporator_blue.png │ │ │ ├── Vaporator_red.png │ │ │ ├── archon_blue.png │ │ │ ├── archon_neutral.png │ │ │ ├── archon_red.png │ │ │ ├── bullet_tree_blue.png │ │ │ ├── bullet_tree_neutral.png │ │ │ ├── bullet_tree_red.png │ │ │ ├── gardener_blue.png │ │ │ ├── gardener_neutral.png │ │ │ ├── gardener_red.png │ │ │ ├── lumberjack_blue.png │ │ │ ├── lumberjack_neutral.png │ │ │ ├── lumberjack_red.png │ │ │ ├── recruit_blue.png │ │ │ ├── recruit_neutral.png │ │ │ ├── recruit_red.png │ │ │ ├── scout_blue.png │ │ │ ├── scout_neutral.png │ │ │ ├── scout_red.png │ │ │ ├── soldier_blue.png │ │ │ ├── soldier_neutral.png │ │ │ ├── soldier_red.png │ │ │ ├── tank_blue.png │ │ │ ├── tank_neutral.png │ │ │ ├── tank_red.png │ │ │ └── unknown.png │ │ │ └── yellow_star.png │ │ ├── robots │ │ ├── center.png │ │ ├── center_blue.png │ │ ├── center_red.png │ │ ├── muck.png │ │ ├── muck_blue.png │ │ ├── muck_red.png │ │ ├── polit.png │ │ ├── polit_blue.png │ │ ├── polit_red.png │ │ ├── slanderer.png │ │ ├── slanderer_blue.png │ │ └── slanderer_red.png │ │ ├── star.png │ │ └── tiles │ │ ├── DirtTerrain.png │ │ ├── RawDirtTerrain.png │ │ ├── RawSwampTerrain.png │ │ ├── SwampTerrain.png │ │ └── terrain.png │ ├── tsconfig.json │ └── webpack.config.js ├── docker-compose.yml ├── engine ├── .gitignore ├── AUTHORS ├── COPYING ├── README.md ├── build.gradle ├── circle.yml ├── settings.gradle └── src │ ├── main │ └── battlecode │ │ ├── common │ │ ├── BodyInfo.java │ │ ├── Clock.java │ │ ├── Direction.java │ │ ├── GameActionException.java │ │ ├── GameActionExceptionType.java │ │ ├── GameConstants.java │ │ ├── MapLocation.java │ │ ├── RobotController.java │ │ ├── RobotInfo.java │ │ ├── RobotType.java │ │ └── Team.java │ │ ├── doc │ │ ├── CostlyMethodTaglet.java │ │ └── RobotTypeTaglet.java │ │ ├── instrumenter │ │ ├── InstrumentationException.java │ │ ├── RobotDeathException.java │ │ ├── SandboxedRobotPlayer.java │ │ ├── TeamClassLoaderFactory.java │ │ ├── Verifier.java │ │ ├── bytecode │ │ │ ├── ClassReferenceUtil.java │ │ │ ├── InstrumentingClassVisitor.java │ │ │ ├── InstrumentingMethodVisitor.java │ │ │ ├── InterfaceReader.java │ │ │ ├── MethodCostUtil.java │ │ │ └── resources │ │ │ │ ├── AllowedPackages.txt │ │ │ │ ├── DisallowedClasses.txt │ │ │ │ └── MethodCosts.txt │ │ ├── inject │ │ │ ├── AtomicInteger.java │ │ │ ├── AtomicLong.java │ │ │ ├── AtomicReference.java │ │ │ ├── ConcurrentHashMap.java │ │ │ ├── InstrumentableFunctions.java │ │ │ ├── ObjectMethods.java │ │ │ ├── RobotMonitor.java │ │ │ ├── System.java │ │ │ ├── Thread.java │ │ │ └── Unsafe.java │ │ ├── profiler │ │ │ ├── Profiler.java │ │ │ ├── ProfilerCollection.java │ │ │ ├── ProfilerEvent.java │ │ │ └── ProfilerEventType.java │ │ └── stream │ │ │ ├── EOFInputStream.java │ │ │ ├── LimitedPrintStream.java │ │ │ ├── PrintStreamWrapper.java │ │ │ ├── RoboPrintStream.java │ │ │ └── SilencedPrintStream.java │ │ ├── schema │ │ ├── Action.java │ │ ├── BodyType.java │ │ ├── BodyTypeMetadata.java │ │ ├── Event.java │ │ ├── EventWrapper.java │ │ ├── GameFooter.java │ │ ├── GameHeader.java │ │ ├── GameMap.java │ │ ├── GameWrapper.java │ │ ├── MatchFooter.java │ │ ├── MatchHeader.java │ │ ├── ProfilerEvent.java │ │ ├── ProfilerFile.java │ │ ├── ProfilerProfile.java │ │ ├── RGBTable.java │ │ ├── Round.java │ │ ├── SpawnedBodyTable.java │ │ ├── TeamData.java │ │ ├── Vec.java │ │ └── VecTable.java │ │ ├── server │ │ ├── Config.java │ │ ├── ErrorReporter.java │ │ ├── GameInfo.java │ │ ├── GameMaker.java │ │ ├── GameState.java │ │ ├── Main.java │ │ ├── NetServer.java │ │ ├── PlayerFinder.java │ │ ├── Server.java │ │ ├── ServerState.java │ │ └── Version.java │ │ ├── util │ │ ├── FlatHelpers.java │ │ ├── SquareArray.java │ │ └── TeamMapping.java │ │ └── world │ │ ├── BuildMaps.java │ │ ├── DominationFactor.java │ │ ├── GameMapIO.java │ │ ├── GameStats.java │ │ ├── GameWorld.java │ │ ├── IDGenerator.java │ │ ├── InternalRobot.java │ │ ├── LiveMap.java │ │ ├── MapBuilder.java │ │ ├── ObjectInfo.java │ │ ├── RobotControllerImpl.java │ │ ├── TeamInfo.java │ │ ├── TestMapBuilder.java │ │ ├── control │ │ ├── NullControlProvider.java │ │ ├── PlayerControlProvider.java │ │ ├── RobotControlProvider.java │ │ └── TeamControlProvider.java │ │ ├── maps │ │ ├── Circle.java │ │ ├── MapTestSmall.java │ │ └── Quadrants.java │ │ └── resources │ │ ├── AmidstWe.map21 │ │ ├── Andromeda.map21 │ │ ├── Arena.map21 │ │ ├── BadSnowflake.map21 │ │ ├── BattleCode.map21 │ │ ├── BattleCodeToo.map21 │ │ ├── BlobWithLegs.map21 │ │ ├── Blotches.map21 │ │ ├── Bog.map21 │ │ ├── Branches.map21 │ │ ├── ButtonsAndBows.map21 │ │ ├── CToE.map21 │ │ ├── Chevron.map21 │ │ ├── Circles.map21 │ │ ├── Corridor.map21 │ │ ├── Cow.map21 │ │ ├── CowTwister.map21 │ │ ├── CringyAsF.map21 │ │ ├── CrossStitch.map21 │ │ ├── CrownJewels.map21 │ │ ├── EggCarton.map21 │ │ ├── ExesAndOhs.map21 │ │ ├── Extensions.map21 │ │ ├── FindYourWay.map21 │ │ ├── FiveOfHearts.map21 │ │ ├── Flawars.map21 │ │ ├── FrogOrBath.map21 │ │ ├── GetShrekt.map21 │ │ ├── Goldfish.map21 │ │ ├── Gridlock.map21 │ │ ├── HappyBoba.map21 │ │ ├── HexesAndOhms.map21 │ │ ├── Hourglass.map21 │ │ ├── Illusion.map21 │ │ ├── InaccurateBritishFlag.map21 │ │ ├── JerryIsEvil.map21 │ │ ├── Legends.map21 │ │ ├── Licc.map21 │ │ ├── MainCampus.map21 │ │ ├── Mario.map21 │ │ ├── Maze.map21 │ │ ├── Misdirection.map21 │ │ ├── Networking.map21 │ │ ├── NextHouse.map21 │ │ ├── NoInternet.map21 │ │ ├── NotAPuzzle.map21 │ │ ├── OneCallAway.map21 │ │ ├── PaperWindmill.map21 │ │ ├── Punctuation.map21 │ │ ├── Radial.map21 │ │ ├── Rainbow.map21 │ │ ├── Randomized.map21 │ │ ├── Saturn.map21 │ │ ├── SeaFloor.map21 │ │ ├── Sediment.map21 │ │ ├── SlowMusic.map21 │ │ ├── Smile.map21 │ │ ├── Snowflake.map21 │ │ ├── SpaceInvaders.map21 │ │ ├── Star.map21 │ │ ├── Stonks.map21 │ │ ├── Superposition.map21 │ │ ├── Surprised.map21 │ │ ├── TheClientMapEditorIsSuperiorToGoogleSheetsEom.map21 │ │ ├── TheSnackThatSmilesBack.map21 │ │ ├── TicTacTie.map21 │ │ ├── Tiger.map21 │ │ ├── UnbrandedWordGame.map21 │ │ ├── VideoGames.map21 │ │ ├── WhatISeeInMyDreams.map21 │ │ ├── Yoda.map21 │ │ ├── Z.map21 │ │ ├── Zodiac.map21 │ │ ├── circle.map21 │ │ ├── maptestsmall.map21 │ │ └── quadrants.map21 │ └── test │ └── battlecode │ ├── common │ ├── DirectionTest.java │ └── MapLocationTest.java │ ├── instrumenter │ ├── LoaderTest.java │ ├── README.weirdtests │ ├── SandboxedRobotPlayerTest.java │ ├── URLUtils.java │ ├── VerifierTest.java │ ├── resources │ │ ├── ValueA.class │ │ ├── ValueB.class │ │ └── java.lang.Double.class │ └── sample │ │ ├── instrumentertest │ │ ├── CallsIllegalMethods.java │ │ ├── CallsMathRandom.java │ │ ├── DoesntOverrideHashCode.java │ │ ├── DoesntOverrideToString.java │ │ ├── IllegalMethodReference.java │ │ ├── LegalMethodReference.java │ │ ├── Nothing.java │ │ ├── Outer.java │ │ ├── OverridesHashCode.java │ │ ├── OverridesToString.java │ │ ├── Reflection.java │ │ ├── StringFormat.java │ │ ├── UsesEnumMap.java │ │ ├── UsesLambda.java │ │ └── UsesThrowable.java │ │ ├── shared │ │ └── SharedUtility.java │ │ ├── testplayeractions │ │ └── RobotPlayer.java │ │ ├── testplayerarray │ │ └── RobotPlayer.java │ │ ├── testplayerarraybytecode │ │ └── RobotPlayer.java │ │ ├── testplayerbytecode │ │ └── RobotPlayer.java │ │ ├── testplayerbytecodekotlin │ │ └── RobotPlayer.kt │ │ ├── testplayerbytecodekotlinintrinsics │ │ └── RobotPlayer.kt │ │ ├── testplayerclock │ │ └── RobotPlayer.java │ │ ├── testplayerdebug │ │ └── RobotPlayer.java │ │ ├── testplayerempty │ │ └── RobotPlayer.java │ │ ├── testplayerloopforever │ │ └── RobotPlayer.java │ │ ├── testplayermultiarraybytecode │ │ └── RobotPlayer.java │ │ ├── testplayernodebug │ │ └── RobotPlayer.java │ │ ├── testplayerstatic │ │ └── RobotPlayer.java │ │ ├── testplayersystem │ │ └── RobotPlayer.java │ │ ├── testplayersystemout │ │ └── RobotPlayer.java │ │ └── testplayerusesshared │ │ └── RobotPlayer.java │ ├── server │ └── GameMakerTest.java │ ├── util │ └── SquareArrayTest.java │ └── world │ ├── GameMapIOTest.java │ ├── GenerateMaps.java │ ├── IDGeneratorTest.java │ ├── RobotControllerTest.java │ ├── TestGame.java │ ├── TestMapBuilder.java │ └── resources │ └── clearMap.map20 ├── example-bots ├── .gitignore ├── README.md ├── build.gradle ├── settings.gradle └── src │ ├── main │ └── examplefuncsplayer │ │ └── RobotPlayer.java │ └── test │ └── nothingbot │ └── Sanity.java ├── frontend ├── .env.development ├── .env.production ├── .eslintrc.js ├── Dockerfile.dev ├── README.md ├── deploy.sh ├── package-lock.json ├── package.json ├── public │ ├── assets │ │ ├── css │ │ │ ├── bc_styles.css │ │ │ ├── bootstrap.min.css │ │ │ ├── light-bootstrap-dashboard.css │ │ │ ├── pe-icon-7-helper.css │ │ │ └── pe-icon-7-stroke.css │ │ ├── fonts │ │ │ ├── Pe-icon-7-stroke.eot │ │ │ ├── Pe-icon-7-stroke.svg │ │ │ ├── Pe-icon-7-stroke.ttf │ │ │ └── Pe-icon-7-stroke.woff │ │ ├── img │ │ │ ├── castle.png │ │ │ ├── church.png │ │ │ ├── crusader.png │ │ │ ├── favicon.png │ │ │ ├── logo.png │ │ │ ├── pilgrim.png │ │ │ ├── preacher.png │ │ │ ├── prophet.png │ │ │ ├── s_castle.png │ │ │ ├── s_church.png │ │ │ ├── s_crusader.png │ │ │ ├── s_pilgrim.png │ │ │ ├── s_preacher.png │ │ │ ├── s_prophet.png │ │ │ └── voyager_vision.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ ├── chartist.min.js │ │ │ ├── jquery-1.10.2.js │ │ │ └── light-bootstrap-dashboard.js │ ├── favicon.png │ ├── favicon_bc.png │ ├── finalresults.json │ ├── houwang_viewer.py │ ├── index.html │ └── visualizer.html ├── screenshot.png └── src │ ├── api.js │ ├── components │ ├── avatar.js │ ├── paginationControl.js │ ├── perfCard.js │ ├── rankingTeamList.js │ ├── scrimmageRequestor.js │ ├── teamCard.js │ ├── teamList.js │ ├── updateCard.js │ ├── userCard.js │ └── userList.js │ ├── footer.js │ ├── index.js │ ├── navbar.js │ ├── sidebar.js │ └── views │ ├── VerifyUser.jsx │ ├── account.js │ ├── codeofconduct.js │ ├── countdown.css │ ├── countdown.js │ ├── debugging.js │ ├── docs.js │ ├── getting-started.js │ ├── home.js │ ├── ide.js │ ├── issues.js │ ├── login.js │ ├── not_found.js │ ├── passwordChange.jsx │ ├── passwordForgot.jsx │ ├── rankings.js │ ├── register.js │ ├── replay.js │ ├── resources.js │ ├── scrimmaging.js │ ├── search.js │ ├── staff.js │ ├── submissions.js │ ├── team.js │ ├── teamInfo.js │ ├── tournaments.js │ ├── updates.js │ └── visualizer.js ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── infrastructure ├── .gitignore ├── Makefile ├── README.md ├── compile.Dockerfile ├── env.Dockerfile ├── game.Dockerfile ├── matcher │ ├── bracketlib.py │ ├── config.py │ ├── maps.json │ ├── replay_dump.json │ ├── scrimmage.py │ ├── team_names │ ├── team_pk │ ├── tournament_server.py │ └── util.py ├── passed_students.sql ├── pub.py ├── scrimmage.Dockerfile ├── tournament-util │ ├── .gitignore │ ├── bracketlib.py │ ├── challonge_pubber.py │ ├── config.py │ ├── csv_to_files.py │ ├── data │ │ ├── 0-example │ │ │ ├── maps.json │ │ │ ├── parsed.txt │ │ │ ├── results.json │ │ │ ├── team_names │ │ │ └── team_pk │ │ └── 1-sprint1 │ │ │ ├── replay_dump.json │ │ │ ├── replay_dump_parsed.txt │ │ │ └── replay_links_only.txt │ ├── finals_seeds.py │ ├── match_list.py │ ├── prep_tournament.sql │ ├── pull_seeding.py │ ├── scrim_ranks.sql │ ├── scrim_ranks_verified.sql │ └── util.py ├── tournament.Dockerfile ├── worker.Dockerfile └── worker │ ├── app │ ├── compile_server.py │ ├── config.py │ ├── game_server.py │ ├── subscription.py │ └── util.py │ └── box │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── settings.gradle │ └── version.txt ├── release_python.py ├── schema ├── .gitignore ├── LICENSE ├── README.md ├── battlecode.fbs ├── java │ └── battlecode │ │ └── schema │ │ ├── Action.java │ │ ├── BodyType.java │ │ ├── BodyTypeMetadata.java │ │ ├── Event.java │ │ ├── EventWrapper.java │ │ ├── GameFooter.java │ │ ├── GameHeader.java │ │ ├── GameMap.java │ │ ├── GameWrapper.java │ │ ├── MatchFooter.java │ │ ├── MatchHeader.java │ │ ├── ProfilerEvent.java │ │ ├── ProfilerFile.java │ │ ├── ProfilerProfile.java │ │ ├── RGBTable.java │ │ ├── Round.java │ │ ├── SpawnedBodyTable.java │ │ ├── TeamData.java │ │ ├── Vec.java │ │ └── VecTable.java ├── js │ └── battlecode_generated.js ├── package-lock.json ├── package.json └── ts │ ├── battlecode_generated.ts │ └── index.ts ├── settings.gradle └── specs ├── README.md ├── css ├── bootstrap.min.css ├── dashboard.css ├── ie10-viewport-bug-workaround.css └── journal.css ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf ├── glyphicons-halflings-regular.woff └── glyphicons-halflings-regular.woff2 ├── js ├── bootstrap.min.js ├── ie10-viewport-bug-workaround.js ├── jquery.min.js └── markdeep.min.js ├── specs.md.html └── template.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | *__pycache__* 4 | *.pyc 5 | .vscode/ 6 | *.code-workspace 7 | venv/ 8 | docker-compose.prod.yml 9 | 10 | engine/dist/* 11 | 12 | .idea 13 | 14 | access.txt 15 | 16 | ## Frontend 17 | frontend/build 18 | 19 | ### Gradle ### 20 | .gradle/ 21 | /build/ 22 | 23 | ### Matches should be ignored 24 | /matches/ 25 | 26 | ### Java 27 | *.classpath 28 | *.project 29 | *.settings 30 | bin/ 31 | 32 | ### Vim 33 | # Swap 34 | [._]*.s[a-v][a-z] 35 | !*.svg # comment out if you don't need vector files 36 | [._]*.sw[a-p] 37 | [._]s[a-rt-v][a-z] 38 | [._]ss[a-gi-z] 39 | [._]sw[a-p] 40 | # Session 41 | Session.vim 42 | Sessionx.vim 43 | # Temporary 44 | .netrwhist 45 | *~ 46 | # Auto-generated tag files 47 | tags 48 | # Persistent undo 49 | [._]*.un~ 50 | 51 | ### Distribution 52 | temp-dist 53 | 54 | ### Javadoc 55 | battlecode-javadoc-* 56 | 57 | ### test bots 58 | battlecode20-internal-test-bots 59 | 60 | test.sh 61 | backend/dev_settings_sensitive.py 62 | 63 | infrastructure/worker/app/gcloud-key.json 64 | 65 | # Resumes 66 | backend/resumes/files/* 67 | backend/resumes/*.csv 68 | -------------------------------------------------------------------------------- /RELEASE_JAVA.md: -------------------------------------------------------------------------------- 1 | # HOW TO RELEASE A JAVA GAME 2 | 3 | ## Prereqs 4 | 5 | a bash-like shell (windows command prompt won't work for this). Also, zsh (and perhaps other shell environments) don't work to run the frontend deploy script. bash seems to work. 6 | 7 | npm 8 | 9 | a git key: Obtain a git key that has "publish packages" permissions. This key is a string. Keep it around somewhere 10 | 11 | ## Get updates 12 | 13 | Make sure you have all the most recent updates to the repo! (Ideally they're pushed to git. Then do git checkout master, git fetch, git pull.) 14 | 15 | ## Update some version numbers 16 | 17 | `client/visualizer/src/config` -- find ``gameVersion`, and update that. 18 | 19 | `gradle.properties` -- update `release_version`. 20 | 21 | Make sure these updates are pushed to master! 22 | 23 | ## Update specs and javadoc 24 | 25 | In our game spec (specs folder), make sure changes are up to date. 26 | 27 | Pay attention to the version number at the top of specs.md.html, and to the changelog at the bottom. 28 | 29 | push to master btw! 30 | 31 | ## Release packages 32 | 33 | Set BC21_GITUSERNAME: `export BC21_GITUSERNAME=n8kim1`, etc 34 | 35 | Set BC21_GITKEY similarly. This git key is the string discussed above. 36 | 37 | ./gradlew publish 38 | 39 | Now set version.txt in gcloud (also set cache policy to no-store) 40 | 41 | ## Deploy frontend 42 | 43 | Run the deploy.sh script! For arguments, follow the instructions in the file. For example: `bash ./deploy.sh deploy 2021.3.0.2` 44 | -------------------------------------------------------------------------------- /RELEASE_PYTHON.md: -------------------------------------------------------------------------------- 1 | # HOW TO RELEASE A PYTHON GAME 2 | 3 | In general, this guide and script may be out of date. Make any changes as necessary. 4 | 5 | ### Preliminaries 6 | - Install the frontend using `npm install`. 7 | - Make sure that if you run `npm run start` in the `frontend` folder, you get a working frontend on `localhost:3000` after a few minutes. 8 | - Install `pandoc` (e.g. using Homebrew) 9 | - Use a bash shell (or something similar — e.g. zsh but not Windows Command Prompt). 10 | 11 | ### Release Procedure 12 | - Make sure everything is up to date: 13 | - `git pull` 14 | - Choose a version as $major.$minor.$patch (e.g. 1.32.2) 15 | - Run `./release.py $version`. 16 | - Go on Discord and wait for things to catch on fire 17 | -------------------------------------------------------------------------------- /backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # Start with a Python image. 2 | FROM python@sha256:6eaf19442c358afc24834a6b17a3728a45c129de7703d8583392a138ecbdb092 3 | 4 | # Some stuff that everyone has been copy-pasting 5 | # since the dawn of time. 6 | ENV PYTHONUNBUFFERED 1 7 | 8 | # Install some necessary things. 9 | RUN apt-get update 10 | RUN apt-get install -y swig libssl-dev dpkg-dev netcat 11 | 12 | # Copy all our files into the image. 13 | RUN mkdir /code 14 | WORKDIR /code 15 | COPY requirements.txt /code/ 16 | 17 | # Install our requirements. 18 | RUN pip install -r requirements.txt 19 | 20 | COPY . /code/ 21 | 22 | CMD ["uwsgi", "--ini", "uwsgi.ini"] 23 | -------------------------------------------------------------------------------- /backend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/backend/__init__.py -------------------------------------------------------------------------------- /backend/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/backend/api/__init__.py -------------------------------------------------------------------------------- /backend/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class APIConfig(AppConfig): 5 | name = 'api' 6 | label = 'api' 7 | -------------------------------------------------------------------------------- /backend/api/migrations/0002_auto_20190811_1452.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.4 on 2019-08-11 14:52 2 | 3 | from django.db import migrations 4 | import datetime 5 | 6 | def add_0_league(apps, schema_editor): 7 | # We can't import the Person model directly as it may be a newer 8 | # version than this migration expects. We use the historical version. 9 | League = apps.get_model('api', 'League') 10 | l0 = League(id=0,name='bc20',start_date=datetime.datetime(year=2019, month=6, day=1),end_date=datetime.datetime(year=2020,month=6,day=1),active=True,submissions_enabled=True) 11 | l0.save() 12 | 13 | class Migration(migrations.Migration): 14 | 15 | dependencies = [ 16 | ('api', '0001_initial'), 17 | ] 18 | 19 | operations = [ 20 | migrations.RunPython(add_0_league), 21 | ] 22 | -------------------------------------------------------------------------------- /backend/api/migrations/0007_league_game_released.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.4 on 2019-11-09 23:27 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0006_auto_20191109_1644'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='league', 15 | name='game_released', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0008_auto_20191110_0252.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.4 on 2019-11-10 02:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0007_league_game_released'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='blue_mu', 16 | field=models.IntegerField(null=True), 17 | ), 18 | migrations.AddField( 19 | model_name='scrimmage', 20 | name='red_mu', 21 | field=models.IntegerField(null=True), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /backend/api/migrations/0009_auto_20191215_2044.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.4 on 2019-12-15 20:44 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0008_auto_20191110_0252'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='team', 15 | name='code', 16 | ), 17 | migrations.AddField( 18 | model_name='team', 19 | name='staff_team', 20 | field=models.BooleanField(default=False), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /backend/api/migrations/0010_team_score.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-10 07:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0009_auto_20191215_2044'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='team', 15 | name='score', 16 | field=models.FloatField(default=0.001), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0011_auto_20200110_0821.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-10 08:21 2 | 3 | from django.db import migrations 4 | 5 | def calculate_score(apps, schema_editor): 6 | Team = apps.get_model('api', 'Team') 7 | for team in Team.objects.all(): 8 | team.score = team.mu - 3*team.sigma 9 | team.save() 10 | 11 | class Migration(migrations.Migration): 12 | 13 | dependencies = [ 14 | ('api', '0010_team_score'), 15 | ] 16 | 17 | operations = [ 18 | migrations.RunPython(calculate_score), 19 | ] 20 | -------------------------------------------------------------------------------- /backend/api/migrations/0012_scrimmage_tournament_id.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-12 19:36 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0011_auto_20200110_0821'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='tournament_id', 16 | field=models.IntegerField(null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0013_auto_20200118_2249.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-18 22:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0012_scrimmage_tournament_id'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='team', 15 | name='high_school', 16 | field=models.BooleanField(default=False), 17 | ), 18 | migrations.AddField( 19 | model_name='team', 20 | name='international', 21 | field=models.BooleanField(default=False), 22 | ), 23 | migrations.AddField( 24 | model_name='team', 25 | name='mit', 26 | field=models.BooleanField(default=False), 27 | ), 28 | migrations.AddField( 29 | model_name='team', 30 | name='student', 31 | field=models.BooleanField(default=False), 32 | ), 33 | ] 34 | -------------------------------------------------------------------------------- /backend/api/migrations/0014_auto_20200119_0609.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-19 06:09 2 | 3 | from django.db import migrations 4 | from django.conf import settings 5 | 6 | def convert_to_elo(apps, schema_editor): 7 | # we want to set the elo of every team with a submission to ELO_START 8 | # and to ELO_NULL if no submission 9 | Team = apps.get_model('api', 'Team') 10 | TeamSubmission = apps.get_model('api', 'TeamSubmission') 11 | for team in Team.objects.all(): 12 | try: 13 | team_sub = TeamSubmission.objects.all().get(team=team) 14 | if team_sub.last_1_id is not None: 15 | team.score = settings.ELO_START 16 | else: 17 | team.score = settings.ELO_NULL 18 | team.save() 19 | except: 20 | team.score = settings.ELO_NULL 21 | team.save() 22 | 23 | class Migration(migrations.Migration): 24 | 25 | dependencies = [ 26 | ('api', '0013_auto_20200118_2249'), 27 | ] 28 | 29 | operations = [ 30 | migrations.RunPython(convert_to_elo), 31 | ] 32 | -------------------------------------------------------------------------------- /backend/api/migrations/0015_auto_20200122_0135.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-22 01:35 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0014_auto_20200119_0609'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='tournament', 15 | name='blurb', 16 | field=models.TextField(blank=True), 17 | ), 18 | migrations.AddField( 19 | model_name='tournament', 20 | name='bracket_link', 21 | field=models.TextField(blank=True), 22 | ), 23 | migrations.AddField( 24 | model_name='tournament', 25 | name='teamsubmission_column_name', 26 | field=models.TextField(default='tour_sprint_id'), 27 | ), 28 | migrations.AlterField( 29 | model_name='team', 30 | name='score', 31 | field=models.FloatField(default=-1000000), 32 | ), 33 | ] 34 | -------------------------------------------------------------------------------- /backend/api/migrations/0016_auto_20200122_0201.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-01-22 02:01 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0015_auto_20200122_0135'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='teamsubmission', 16 | name='tour_hs', 17 | field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tour_hs', to='api.Submission'), 18 | ), 19 | migrations.AddField( 20 | model_name='teamsubmission', 21 | name='tour_intl_qual', 22 | field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tour_intl_qual', to='api.Submission'), 23 | ), 24 | migrations.AddField( 25 | model_name='teamsubmission', 26 | name='tour_newbie', 27 | field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tour_newbie', to='api.Submission'), 28 | ), 29 | ] 30 | -------------------------------------------------------------------------------- /backend/api/migrations/0017_auto_20200416_0448.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-04-16 04:48 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0016_auto_20200122_0201'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='team', 15 | name='auto_accept_unranked', 16 | field=models.BooleanField(default=True), 17 | ), 18 | migrations.AlterField( 19 | model_name='team', 20 | name='international', 21 | field=models.BooleanField(default=True), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /backend/api/migrations/0018_auto_20200416_2354.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.8 on 2020-04-16 23:54 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0017_auto_20200416_0448'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='team', 15 | name='auto_accept_ranked', 16 | field=models.BooleanField(default=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0019_scrimmage_winscore.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2020-12-27 02:03 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0018_auto_20200416_2354'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='winscore', 16 | field=models.IntegerField(null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0020_scrimmage_losescore.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2020-12-27 17:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0019_scrimmage_winscore'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='losescore', 16 | field=models.IntegerField(null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0021_auto_20210104_0550.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-04 05:50 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0020_scrimmage_losescore'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='scrimmage', 15 | name='status', 16 | field=models.TextField(choices=[('created', 'Created'), ('pending', 'Pending'), ('queued', 'Queued'), ('running', 'Running'), ('redwon', 'Red Won!'), ('bluewon', 'Blue Won!'), ('rejected', 'Rejected'), ('failed', 'Failed'), ('cancelled', 'Cancelled')], default='created'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0022_auto_20210104_0807.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-04 08:07 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0021_auto_20210104_0550'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='team', 15 | name='divisions', 16 | field=models.CharField(max_length=64), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0023_auto_20210104_0810.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-04 08:10 2 | 3 | import django.contrib.postgres.fields 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0022_auto_20210104_0807'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='team', 16 | name='divisions', 17 | field=django.contrib.postgres.fields.ArrayField(base_field=models.TextField(choices=[('highschool', 'High School'), ('newbie', 'Newbie'), ('college', 'College'), ('pro', 'Pro')]), default=list, size=None), 18 | ), 19 | migrations.AlterField( 20 | model_name='tournament', 21 | name='divisions', 22 | field=models.TextField(blank=True), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /backend/api/migrations/0024_scrimmage_map_ids.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-04 09:20 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0023_auto_20210104_0810'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='map_ids', 16 | field=models.TextField(blank=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0025_auto_20210104_0921.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-04 09:21 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0024_scrimmage_map_ids'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='scrimmage', 15 | name='map_ids', 16 | field=models.TextField(null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0026_auto_20210105_0702.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-05 07:02 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0025_auto_20210104_0921'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='blue_submission_id', 16 | field=models.IntegerField(null=True), 17 | ), 18 | migrations.AddField( 19 | model_name='scrimmage', 20 | name='red_submission_id', 21 | field=models.IntegerField(null=True), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /backend/api/migrations/0027_auto_20210106_0308.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-06 03:08 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0026_auto_20210105_0702'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scrimmage', 15 | name='error_msg', 16 | field=models.TextField(blank=True), 17 | ), 18 | migrations.AddField( 19 | model_name='submission', 20 | name='error_msg', 21 | field=models.TextField(blank=True), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /backend/api/migrations/0028_auto_20210107_0126.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-07 01:26 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0027_auto_20210106_0308'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='scrimmage', 15 | name='error_msg', 16 | field=models.TextField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/0029_auto_20210107_0137.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.13 on 2021-01-07 01:37 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0028_auto_20210107_0126'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='submission', 15 | name='error_msg', 16 | field=models.TextField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/backend/api/migrations/__init__.py -------------------------------------------------------------------------------- /backend/api/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | Public endpoints. 3 | """ 4 | 5 | from django.urls import path 6 | from rest_framework.routers import DefaultRouter 7 | 8 | from . import views 9 | 10 | router = DefaultRouter() 11 | router.register('user/profile', views.UserProfileViewSet, base_name='userprofile') 12 | router.register('user', views.UserViewSet, base_name='user') 13 | router.register('verify', views.VerifyUserViewSet, base_name='verify') 14 | router.register('league', views.LeagueViewSet, base_name='league') 15 | router.register('(?P[^\/.]+)/team', views.TeamViewSet, base_name='team') 16 | router.register('(?P[^\/.]+)/submission', views.SubmissionViewSet, base_name='submission') 17 | router.register('(?P[^\/.]+)/teamsubmission', views.TeamSubmissionViewSet, base_name='teamsubmission') 18 | router.register('(?P[^\/.]+)/scrimmage', views.ScrimmageViewSet, base_name='scrimmage') 19 | router.register('(?P[^\/.]+)/tournament', views.TournamentViewSet, base_name='tournament') 20 | router.register('userteam/(?P[^\/]+)', views.UserTeamViewSet, base_name='userteam') 21 | router.register('match', views.MatchmakingViewSet, base_name='match') 22 | 23 | urlpatterns = router.urls 24 | -------------------------------------------------------------------------------- /backend/backend_script.py: -------------------------------------------------------------------------------- 1 | # domain = 'http://2021.battlecode.org/' 2 | domain = 'http://localhost:8000/' 3 | 4 | import dev_settings_sensitive 5 | import requests 6 | import json 7 | 8 | data = { 9 | 'username': 'database_admin', 10 | 'password': dev_settings_sensitive.ADMIN_PASS 11 | } 12 | 13 | response = requests.post(domain + 'auth/token/', data=data) 14 | token = json.loads(response.text)['access'] 15 | 16 | data = { 17 | 'type': 'scrimmage', 18 | 'tournament_id': '0', 19 | 'player1': '1744', 20 | 'player2': '1810', 21 | } 22 | 23 | headers = {"Authorization": "Bearer " + token} 24 | 25 | response = requests.post(domain + 'api/match/enqueue/', data=data, headers=headers) 26 | 27 | print(response.text) 28 | -------------------------------------------------------------------------------- /backend/docs/ELIGIBILITY.md: -------------------------------------------------------------------------------- 1 | # Database and Eligibility columns 2 | 3 | In our team table of the database are four columns: `high_school`, `international`, `mit`, and `student`. Unfortunately, these names don't actually mean what they may seem at first glance... 4 | 5 | `high_school=True` means that the team is all high school students. (This should be a strict subset of `student` -- that is, `student` can not be false while `high_school` is true, unless someone filled something out wrong.) 6 | 7 | `international=True` means that the team is **not [all (US students)]**. (i.e. at least one non-student and/or one int'l person.) The value of `international` is the boolean opposite of the "US students" checkbox in the frontend. **A team participates in the Intl Tournament if and only if `international=True` and `student=True`.** 8 | 9 | `mit=True` means that the team is all **newbies**. 10 | 11 | `student=True` means that the team is all full-time students. 12 | 13 | (Changing the column names requires either server downtime or messy workarounds. Perhaps when the competition isn't active, it'd be a good idea to rethink what information we hold about a team, or what the columns are named.) -------------------------------------------------------------------------------- /backend/docs/cors.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "method": [ 4 | "GET", 5 | "PUT" 6 | ], 7 | "origin": [ 8 | "http://localhost:3000", 9 | "http://2021.battlecode.org", 10 | "https://2021.battlecode.org" 11 | ], 12 | "responseHeader": [ 13 | "authorization", 14 | "content-type" 15 | ] 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /backend/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /backend/requirements.txt: -------------------------------------------------------------------------------- 1 | coreapi==2.3.3 2 | coreschema==0.0.4 3 | coverage==4.5.4 4 | Django==2.2.13 5 | django-cors-headers==3.0.2 6 | django-debug-toolbar==2.0 7 | django-nose==1.4.6 8 | django-rest-passwordreset==1.0.0 9 | django-webpack-loader==0.6.0 10 | djangorestframework==3.9.4 11 | djangorestframework-simplejwt==4.3.0 12 | itypes==1.1.0 13 | Jinja2==2.10.1 14 | MarkupSafe==1.1.1 15 | nose==1.3.7 16 | psycopg2==2.8.3 17 | PyJWT==1.7.1 18 | six==1.12.0 19 | sqlparse==0.3.0 20 | uritemplate==3.0.0 21 | uWSGI==2.0.18 22 | cachetools==3.1.1 23 | certifi==2019.9.11 24 | chardet==3.0.4 25 | google-api-core==1.14.3 26 | google-auth==1.6.3 27 | google-cloud-core==1.0.3 28 | google-cloud-storage==1.20.0 29 | google-cloud-pubsub==1.1.0 30 | google-resumable-media==0.4.1 31 | googleapis-common-protos==1.6.0 32 | idna==2.8 33 | protobuf==3.10.0 34 | pyasn1==0.4.7 35 | pyasn1-modules==0.2.7 36 | pytz==2019.3 37 | requests==2.22.0 38 | rsa==4.0 39 | urllib3==1.25.6 40 | trueskill==0.4.5 41 | sendgrid==6.1.0 42 | -------------------------------------------------------------------------------- /backend/resumes/notes.txt: -------------------------------------------------------------------------------- 1 | First, we need info about all of the users. See `sql.txt` for two scripts, that produce two files (users_all.csv, users_teams.csv). Run the scripts and save the csvs, according to the instructions in sql.txt. 2 | 3 | Next, run the `download.py` script. **Make sure to update GCLOUD_BUCKET_RESUMES!** 4 | For posterity, here's an outline of what it does: 5 | pull all resumes (for all verified ones), preserve user ids 6 | for each group of users (hs us, hs intl, college us, college intl, others that aren't devs): 7 | in ascending scrim rank, find associated resume 8 | rename to "#elo FirstLastResume" 9 | Also for users in users_all not in users_teams find resume as "FirstLastResume" 10 | 11 | Then, the resumes are in the `files` folder! Make sure to go through all of them, to remove any pdfs that seem corrupt, throwaway resumes (eg blank files), etc. 12 | 13 | Then publish them (we usually just upload all of them to a gdrive folder) and share them with sponsors! 14 | -------------------------------------------------------------------------------- /backend/resumes/sql.txt: -------------------------------------------------------------------------------- 1 | Downloading all users with resumes: run the following query. Export (including headers) to a csv and save as `users_all.csv` in this directory. (This export can be done through GUIs, or through the `COPY` or `\copy` commands, here: https://dataschool.com/learn-sql/export-to-csv-from-psql/) 2 | 3 | ``` 4 | SELECT api_user.id, api_user.first_name, api_user.last_name FROM api_user 5 | WHERE api_user.verified=True 6 | ORDER BY api_user.id 7 | ``` 8 | 9 | ----- 10 | 11 | Downloading all competitive resume users _on teams_ and team info: run the following query. Export (including headers) to a csv, save as `users_teams.csv` in this directory. 12 | 13 | ``` 14 | SELECT api_user.id, api_user.first_name, api_user.last_name, api_team_users.team_id, api_team.score, api_team.high_school, api_team.international, api_team.student 15 | FROM api_user 16 | LEFT JOIN api_team_users on api_user.id=api_team_users.user_id 17 | LEFT JOIN api_team on api_team_users.team_id=api_team.id 18 | WHERE api_user.verified=True and api_team.staff_team=False 19 | ORDER BY api_user.id 20 | ``` 21 | -------------------------------------------------------------------------------- /backend/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {% block main %}{% endblock %} 10 | 11 | -------------------------------------------------------------------------------- /backend/templates/email/password_reset.html: -------------------------------------------------------------------------------- 1 |

Hello, {{ username|safe }}!

2 | 3 |

4 | Click here to reset your password. Link 5 | expires in 24 hours. 6 |

7 | -------------------------------------------------------------------------------- /backend/templates/email/verification.html: -------------------------------------------------------------------------------- 1 |

Hello, {{ username|safe }}!

2 | 3 |

Your password verification key is {{ verification_key }}.

4 |

You can click here to verify your email.

5 | -------------------------------------------------------------------------------- /backend/templates/view.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load render_bundle from webpack_loader %} 3 | 4 | {% block main %} 5 |
6 | {% render_bundle 'vendors' %} 7 | {% render_bundle 'App' %} 8 | 20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /backend/tournaments/dev_settings_sensitive.py: -------------------------------------------------------------------------------- 1 | ../dev_settings_sensitive.py -------------------------------------------------------------------------------- /backend/tournaments/tournament.sql: -------------------------------------------------------------------------------- 1 | -- MAKE A BACKUP ON GCLOUD BEFORE RUNNING THIS 2 | -- Also run this in steps not as a file 3 | 4 | -- 1: Set submissions_enabled to False in api_league 5 | update api_league set submissions_enabled=FALSE; 6 | 7 | -- 2: Change `tour_seed_id` to the current tournament 8 | update api_teamsubmission set tour_seed_id = last_1_id; 9 | 10 | -- 3: Add the tournament to the tournaments table 11 | insert into api_tournament (id, "name", style, date_time, divisions, stream_link, hidden, league_id) 12 | values (2, 'Seeding', 'doubleelim', CURRENTDATE, '{college}', STREAMLINK, True, 0); 13 | 14 | 15 | 16 | -- Get the emails of winning teams 17 | SELECT email from api_user left join api_team_users on api_team_users.user_id = api_user.id 18 | left join api_team on api_team_users.team_id = api_team.id 19 | WHERE api_team."name" in ('wining', 'team', 'names'); 20 | 21 | -- Lock in submissions for more advanced tournaments 22 | UPDATE api_teamsubmission SET tour_intl_qual_id=last_1_id FROM api_team WHERE api_team.id=api_teamsubmission.team_id AND api_team.international AND api_team.student; -------------------------------------------------------------------------------- /backend/uwsgi-dev.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | module=wsgi:application 3 | master=True 4 | home=venv 5 | vacuum=True 6 | max-requests=5000 7 | http-socket=:80 8 | processes=3 9 | harakiri=20 10 | -------------------------------------------------------------------------------- /backend/uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | module=wsgi:application 3 | chdir=/code 4 | master=True 5 | pidfile=/tmp/project-master.pid 6 | vacuum=True 7 | max-requests=5000 8 | http-socket=:80 9 | processes=3 10 | harakiri=20 11 | -------------------------------------------------------------------------------- /backend/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for api project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /client/.editorconfig: -------------------------------------------------------------------------------- 1 | # Configuring editor styles - https://editorconfig.org/ 2 | 3 | # Basically keeping the legacy settings 4 | 5 | # this is top-most .editorconfig file 6 | root = true 7 | 8 | # Default config 9 | # 2 space indent 10 | # Unix style endline 11 | # UTF-8 encoding 12 | # final newline 13 | [*] 14 | indent_style = space 15 | indent_size = 2 16 | end_of_line = lf 17 | charset = utf-8 18 | insert_final_newline = true 19 | 20 | # For .js or .ts files 21 | [*.{js,ts}] 22 | trim_trailing_whitespace = true 23 | 24 | # For *.json files (packages.json, tsconfig.json, webpack.json, ...) 25 | [*.json] 26 | trim_trailing_whitespace = false 27 | -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | # .gitignore file for visualizer and playback 2 | # feel free to add additional local paths with brief explanation 3 | 4 | # installed npm modules 5 | */node_modules/ 6 | 7 | # bundled visualizer 8 | visualizer/out/ 9 | 10 | # bundled playback 11 | playback/out/ 12 | 13 | # built client 14 | dist/ 15 | 16 | # Generated test bc21 files 17 | examples/ 18 | 19 | # any battlecode files 20 | *.bc21 21 | 22 | # for mac users? 23 | **/.DS_Store 24 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | # Battlecode Client 🌱 2 | 3 | ## Overview 4 | Trivial wrapping folder for `playback` and `visualizer`. It handles universal configurations or scripts. 5 | 6 | * `.editorconfig` 7 | * `LICENSE` 8 | * `.gitignore` 9 | * `package.json` 10 | 11 | ### NPM config 12 | Look at `package.json`. 13 | 14 | This NPM module does not have any dependencies or meaningful output, but it is for wrapping scripts of `playback` and `visualizer` in one place. 15 | 16 | * `npm run install-all`: Installs npm packages in `playback` and `visualizer`. **Execute this when you start** 17 | * `npm run build`, `npm run build_playback` 18 | * `npm run electron`: Run the client in electron. You might want to run this most of the time. 19 | * `npm run watch`: Watch for the changes of `visualizer`. Note that it *does not watch* `playback`. 20 | * `npm run prod-electron`, `npm run prod-electron-no-sign`, `npm run prod-test` 21 | * `npm run clean`: Cleans `dist/`. (output folder of `prod`) 22 | -------------------------------------------------------------------------------- /client/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battlecode-client", 3 | "version": "2021.0.0", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battlecode-client", 3 | "version": "2021.0.0", 4 | "description": "Client wrapper of visualizer and playback", 5 | "main": "visualizer/electron-main.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "install-all": "(cd playback && npm install) && (cd visualizer && npm install)", 9 | "clean": "rm -rf dist/", 10 | "build": "(cd playback && npm run build) && (cd visualizer && npm run build)", 11 | "build-playback": "(cd playback && npm run build)", 12 | "electron": "npm run build-playback && (cd visualizer && npm run electron)", 13 | "watch": "npm run build-playback && (cd visualizer && npm run watch)", 14 | "prod-electron": "npm run build-playback && (cd visualizer && npm run prod-electron)", 15 | "prod-electron-no-sign": "npm run build-playback && (cd visualizer && npm run prod-electron-no-sign)", 16 | "prod-test": "npm run build-playback && (cd visualizer && npm run prod-test)" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/battlecode/battlecode21.git" 21 | }, 22 | "author": "Teh Devs", 23 | "license": "GPL-3.0", 24 | "bugs": { 25 | "url": "https://github.com/battlecode/battlecode21/issues" 26 | }, 27 | "homepage": "https://github.com/battlecode/battlecode21#readme", 28 | "dependencies": {} 29 | } 30 | -------------------------------------------------------------------------------- /client/playback/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battlecode-playback", 3 | "description": "Play back and analyze battlecode match files.", 4 | "author": "Teh Devs", 5 | "license": "GPL-3.0", 6 | "private": true, 7 | "main": "out/index.js", 8 | "typings": "out/index.d.ts", 9 | "scripts": { 10 | "clean": "rm -rf out", 11 | "build": "tsc -p src", 12 | "check": "tsc -p src --noEmit --pretty | less -r", 13 | "lint": "tslint 'src/**/*.ts'", 14 | "gen": "mkdir -p ../examples/ && ts-node src/gen/create.ts", 15 | "watch": "tsc -w -p src", 16 | "test": "npm run gen && blue-tape \"out/gen/test/**/*.js\" | tap-dot" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "github.com/battlecode/battlecode21" 21 | }, 22 | "dependencies": { 23 | "battlecode-schema": "file:../../schema", 24 | "core-js": "^3.3.6", 25 | "deepcopy": "^2.0.0", 26 | "pako": "^1.0.10", 27 | "victor": "^1.1.0" 28 | }, 29 | "devDependencies": { 30 | "@types/blue-tape": "^0.1.33", 31 | "@types/core-js": "^2.5.2", 32 | "@types/node": "^12.12.5", 33 | "@types/pako": "^1.0.1", 34 | "@types/victor": "^1.1.0", 35 | "blue-tape": "^1.0.0", 36 | "npm-force-resolutions": "0.0.3", 37 | "stream": "0.0.2", 38 | "tap-dot": "^2.0.0", 39 | "ts-node": "^8.4.1", 40 | "tslint": "^5.20.0", 41 | "typescript": "^3.6.4" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /client/playback/src/gen/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "moduleResolution": "node", 5 | "outDir": "../../out", 6 | "target": "es6", 7 | "typeRoots": [ 8 | "../../node_modules/@types" 9 | ], 10 | "lib": [ "es2016", "dom" ], 11 | }, 12 | "include": [ 13 | "**/*.ts", 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /client/playback/src/index.ts: -------------------------------------------------------------------------------- 1 | import GameWorld from './gameworld'; 2 | import * as gameworld from './gameworld'; 3 | import Metadata from './metadata'; 4 | import * as metadata from './metadata'; 5 | import StructOfArrays from './soa'; 6 | import * as soa from './soa'; 7 | import Match from './match'; 8 | import { Log } from './gameworld'; 9 | import Game, {playbackConfig} from './game'; 10 | import { flatbuffers, schema } from 'battlecode-schema'; 11 | 12 | export {Game, Log, Match, GameWorld, gameworld, Metadata, metadata, StructOfArrays, soa, flatbuffers, schema, playbackConfig}; 13 | 14 | // TODO provide ergonomic main export 15 | -------------------------------------------------------------------------------- /client/playback/src/legacy/bench/run.ts: -------------------------------------------------------------------------------- 1 | import {readFileSync} from 'fs'; 2 | import {crunch} from '../simulator'; 3 | import {schema, flatbuffers} from 'battlecode-schema'; 4 | 5 | const wrapper = schema.GameWrapper.getRootAsGameWrapper( 6 | new flatbuffers.ByteBuffer(new Uint8Array(readFileSync('test.bc21'))) 7 | ); 8 | 9 | crunch(wrapper); 10 | -------------------------------------------------------------------------------- /client/playback/src/legacy/bench/runTimeline.ts: -------------------------------------------------------------------------------- 1 | import {readFileSync} from 'fs'; 2 | import {crunch} from '../simulator'; 3 | import {schema, flatbuffers} from 'battlecode-schema'; 4 | import Game from '../../game'; 5 | 6 | const wrapper = schema.GameWrapper.getRootAsGameWrapper( 7 | new flatbuffers.ByteBuffer(new Uint8Array(readFileSync('test.bc21'))) 8 | ); 9 | 10 | const game = new Game(); 11 | game.loadFullGame(wrapper); 12 | 13 | for (let i = 0; i < game.matchCount; i++) { 14 | console.log(`running game ${i}`); 15 | game.getMatch(i).compute(0); 16 | } 17 | -------------------------------------------------------------------------------- /client/playback/src/legacy/simulator.ts: -------------------------------------------------------------------------------- 1 | import Metadata from '../metadata'; 2 | import GameWorld from '../gameworld'; 3 | import {schema} from 'battlecode-schema'; 4 | 5 | /** 6 | * A function that runs through a GameWrapper containing a single match, and 7 | * returns the state of the world at the end of the game. 8 | * 9 | * Intended for testing. 10 | */ 11 | export function crunch(game: schema.GameWrapper): GameWorld { 12 | const gameHeader = game.events(0).e(new schema.GameHeader()) as schema.GameHeader; 13 | const metadata = new Metadata().parse(gameHeader); 14 | const world = new GameWorld(metadata); 15 | const matchHeader = game.events(1).e(new schema.MatchHeader()) as schema.MatchHeader; 16 | world.loadFromMatchHeader(matchHeader); 17 | 18 | for (let i = 2;; i++) { 19 | const event = game.events(i); 20 | if (event.eType() === schema.Event.MatchFooter) { 21 | return world; 22 | } 23 | // must be a Round 24 | world.processDelta(event.e(new schema.Round()) as schema.Round); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /client/playback/src/legacy/test/game.ts: -------------------------------------------------------------------------------- 1 | import {schema, flatbuffers} from 'battlecode-schema'; 2 | import {createGameHeader, createEventWrapper} from '../../gen/create'; 3 | 4 | function createMatch(matches: number, turnsPerMatch: number): flatbuffers.Offset { 5 | let builder = new flatbuffers.Builder(); 6 | const header = createGameHeader(builder); 7 | let events: flatbuffers.Offset[] = []; 8 | 9 | events.push(createEventWrapper(builder, createGameHeader(builder), schema.Event.GameHeader)); 10 | 11 | for (let i = 0; i < matches; i++) { 12 | schema.GameMap.startGameMap(builder); 13 | schema.GameMap.addMinCorner(builder, schema.Vec.createVec(builder, -1000, -1000)); 14 | schema.GameMap.addMaxCorner(builder, schema.Vec.createVec(builder, 100000, 100000)); 15 | const map = schema.GameMap.endGameMap(builder); 16 | 17 | schema.MatchHeader.startMatchHeader(builder); 18 | schema.MatchHeader.addMaxRounds(builder, turnsPerMatch); 19 | schema.MatchHeader.addMap(builder, map); 20 | events.push(createEventWrapper(builder, schema.MatchHeader.endMatchHeader(builder), schema.Event.MatchHeader)); 21 | 22 | 23 | 24 | } 25 | 26 | return -1; 27 | } 28 | -------------------------------------------------------------------------------- /client/playback/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "moduleResolution": "node", 5 | "outDir": "../out", 6 | "target": "es6", 7 | "declaration": true, 8 | "typeRoots": [ 9 | "../../node_modules/@types" 10 | ], 11 | "lib": [ "es2016", "dom" ], 12 | }, 13 | "include": [ 14 | "*.ts", 15 | ], 16 | "exclude": [ 17 | "legacy/**" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /client/visualizer/build/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/build/icon.png -------------------------------------------------------------------------------- /client/visualizer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Battlecode Client 5 | 6 | 7 | 8 |
9 | 10 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /client/visualizer/src/gamearea/fps.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * FPS Counter math. 3 | */ 4 | export default class TickCounter { 5 | private smoothing: number; 6 | private updateEvery: number; 7 | private lastUpdate: number; 8 | private ticksSinceUpdate: number; 9 | 10 | /** 11 | * Ticks per second. 12 | */ 13 | tps: number; 14 | 15 | /** 16 | * @param smoothing 17 | * @param updateEvery how frequently to update the FPS counter, in ms 18 | */ 19 | constructor(smoothing: number, updateEvery: number) { 20 | this.smoothing = smoothing; 21 | this.updateEvery = updateEvery; 22 | this.lastUpdate = 0; 23 | this.ticksSinceUpdate = 0; 24 | this.tps = 0; 25 | } 26 | 27 | /** 28 | * @param time the system time in ms 29 | * @param ticks the ticks since the last update 30 | */ 31 | update(time: number, ticks: number) { 32 | this.ticksSinceUpdate += ticks; 33 | 34 | if (time > this.lastUpdate + this.updateEvery) { 35 | this.lastUpdate = time; 36 | this.tps = this.smoothing * (this.ticksSinceUpdate / (this.updateEvery / 1000)) + 37 | (1 - this.smoothing) * this.tps; 38 | this.ticksSinceUpdate = 0; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /client/visualizer/src/gamearea/index.ts: -------------------------------------------------------------------------------- 1 | import GameArea from './gamearea'; 2 | import Renderer from './renderer'; 3 | import TickCounter from './fps'; 4 | import {NextStepSchema} from './nextstep'; 5 | import NextStep from './nextstep'; 6 | 7 | export { GameArea, Renderer, TickCounter, NextStepSchema, NextStep }; 8 | -------------------------------------------------------------------------------- /client/visualizer/src/mapeditor/index.ts: -------------------------------------------------------------------------------- 1 | import {MapUnit} from './form'; 2 | import MapGenerator from './action/generator'; 3 | import {UploadedMap}from './action/generator'; 4 | import MapRenderer from './action/renderer'; 5 | import MapValidator from './action/validator'; 6 | 7 | import HeaderForm from './forms/header'; 8 | import RobotForm from './forms/robots'; 9 | import SymmetryForm, {Symmetry} from './forms/symmetry'; 10 | import TileForm from './forms/tiles'; 11 | 12 | import {GameMap} from './form'; 13 | import MapEditorForm from './form'; 14 | import MapEditor from './mapeditor'; 15 | 16 | export {MapGenerator, MapUnit, MapRenderer, MapValidator, UploadedMap} 17 | export {HeaderForm, RobotForm, Symmetry, SymmetryForm, TileForm} 18 | export {GameMap, MapEditorForm, MapEditor}; 19 | -------------------------------------------------------------------------------- /client/visualizer/src/profiler.ts: -------------------------------------------------------------------------------- 1 | // This script is loaded by speedscope in the iframe shown in the game area when the Profiler tab is visible 2 | // It listens for messages passed via window.postMessage 3 | 4 | function applyCSS(css: string): void { 5 | const style = document.createElement('style'); 6 | style.innerHTML = css; 7 | document.head.appendChild(style); 8 | } 9 | 10 | function load(data: any): void { 11 | (window as any).speedscope.loadFileFromBase64('data.json', btoa(JSON.stringify(data))); 12 | } 13 | 14 | window.addEventListener('message', event => { 15 | const data = event.data; 16 | 17 | switch (data.type) { 18 | case 'apply-css': 19 | applyCSS(data.payload); 20 | break; 21 | case 'load': 22 | load(data.payload); 23 | break; 24 | } 25 | }); 26 | 27 | // Make sure the "flamegraph" link on the homepage opens in a new tab instead of inside the iframe itself 28 | document.addEventListener('click', event => { 29 | const target = event.target as HTMLElement; 30 | if (target.tagName === 'A' 31 | && target.getAttribute('href') === 'http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html') { 32 | window.open('http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html', '_blank'); 33 | event.preventDefault(); 34 | } 35 | }); 36 | -------------------------------------------------------------------------------- /client/visualizer/src/sidebar/index.ts: -------------------------------------------------------------------------------- 1 | import Console from './console'; 2 | import MapFilter from './mapfilter'; 3 | import {MapSchema} from './mapfilter'; 4 | import MatchQueue from './matchqueue'; 5 | import MatchRunner from './matchrunner'; 6 | import Stats from './stats'; 7 | import Profiler from './profiler'; 8 | import {MapType} from '../constants'; 9 | 10 | export {Console, MapType, MapSchema, MapFilter, MatchQueue, MatchRunner, Stats, Profiler}; -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/go-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/go-end.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/go-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/go-next.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/go-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/go-previous.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/green-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/green-next.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/green-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/green-previous.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/playback-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/playback-pause.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/playback-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/playback-start.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/playback-stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/playback-stop.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/reverse.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/skip-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/skip-backward.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/skip-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/skip-forward.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/controls/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/controls/upload.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/camouflage/camo_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/camouflage/camo_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/camouflage/camo_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/camouflage/camo_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/death/death_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/death/death_empty.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/embezzle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/embezzle.gif -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/embezzle_blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/embezzle_blue.gif -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/embezzle_red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/embezzle_red.gif -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_blue_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_blue_1.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_blue_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_blue_2.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_empty_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_empty_1.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_empty_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_empty_2.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_red_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_red_1.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_red_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/embezzle/slanderer_embezzle_red_2.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/empower.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/empower.gif -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/empower_blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/empower_blue.gif -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/empower_red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/empower_red.gif -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/polit_empower_blue_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/polit_empower_blue_1.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/polit_empower_blue_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/polit_empower_blue_2.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/polit_empower_empty_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/polit_empower_empty_1.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/polit_empower_empty_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/polit_empower_empty_2.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/polit_empower_red_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/polit_empower_red_1.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/empower/polit_empower_red_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/empower/polit_empower_red_2.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/expose/expose_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/expose/expose_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/expose/expose_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/expose/expose_empty.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/expose/expose_empty_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/expose/expose_empty_small.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/effects/expose/expose_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/effects/expose/expose_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/bullets/bullet_fast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/bullets/bullet_fast.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/bullets/bullet_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/bullets/bullet_medium.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/bullets/bullet_slow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/bullets/bullet_slow.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/go-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/go-next.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/go-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/go-previous.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/playback-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/playback-pause.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/playback-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/playback-start.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/playback-stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/playback-stop.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/seek-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/seek-backward.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/seek-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/seek-forward.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/skip-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/skip-backward.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/skip-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/skip-forward.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/controls/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/controls/upload.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/map/full_health_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/map/full_health_tree.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/map/low_health_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/map/low_health_tree.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/map/sapling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/map/sapling.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/map/tiled_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/map/tiled_1.jpg -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/map/tree_bullets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/map/tree_bullets.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/map/tree_robots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/map/tree_robots.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/soup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/soup.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Cow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Cow.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Drone_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Drone_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Drone_blue_carry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Drone_blue_carry.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Drone_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Drone_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Drone_red_carry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Drone_red_carry.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Fulfillment_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Fulfillment_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Fulfillment_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Fulfillment_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/HQ_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/HQ_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/HQ_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/HQ_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Landscaper_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Landscaper_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Landscaper_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Landscaper_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Miner_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Miner_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Miner_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Miner_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Net_gun_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Net_gun_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Net_gun_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Net_gun_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Refinery_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Refinery_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Refinery_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Refinery_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/SOUPER_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/SOUPER_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/SOUPER_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/SOUPER_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Vaporator_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Vaporator_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/Vaporator_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/Vaporator_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/archon_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/archon_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/archon_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/archon_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/archon_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/archon_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/bullet_tree_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/bullet_tree_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/bullet_tree_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/bullet_tree_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/bullet_tree_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/bullet_tree_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/gardener_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/gardener_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/gardener_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/gardener_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/gardener_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/gardener_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/lumberjack_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/lumberjack_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/lumberjack_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/lumberjack_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/lumberjack_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/lumberjack_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/recruit_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/recruit_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/recruit_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/recruit_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/recruit_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/recruit_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/scout_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/scout_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/scout_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/scout_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/scout_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/scout_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/soldier_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/soldier_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/soldier_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/soldier_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/soldier_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/soldier_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/tank_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/tank_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/tank_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/tank_neutral.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/tank_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/tank_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/sprites/unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/sprites/unknown.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/legacy/~2020/yellow_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/legacy/~2020/yellow_star.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/center.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/center_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/center_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/center_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/center_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/muck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/muck.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/muck_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/muck_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/muck_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/muck_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/polit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/polit.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/polit_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/polit_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/polit_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/polit_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/slanderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/slanderer.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/slanderer_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/slanderer_blue.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/robots/slanderer_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/robots/slanderer_red.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/star.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/tiles/DirtTerrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/tiles/DirtTerrain.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/tiles/RawDirtTerrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/tiles/RawDirtTerrain.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/tiles/RawSwampTerrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/tiles/RawSwampTerrain.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/tiles/SwampTerrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/tiles/SwampTerrain.png -------------------------------------------------------------------------------- /client/visualizer/src/static/img/tiles/terrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/client/visualizer/src/static/img/tiles/terrain.png -------------------------------------------------------------------------------- /client/visualizer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // TODO: is it really a good idea to have es5 as target and es2016 in the lib section?? 4 | "target": "es5", 5 | "strictNullChecks": true, 6 | "sourceMap": true, 7 | "lib": ["es2016", "dom"], 8 | "types": ["node"] 9 | }, 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | 5 | frontend: 6 | build: 7 | context: ./frontend 8 | dockerfile: Dockerfile.dev 9 | volumes: 10 | - ./frontend:/frontend 11 | - ./client:/client 12 | #issue with which node_modules folder docker sees (see https://github.com/barrysteyn/node-scrypt/issues/148) 13 | - ./client/visualizer/node_modules 14 | - ./client/playback/node_modules 15 | - ./schema:/schema 16 | ports: 17 | - 3000:3000 18 | # environment: 19 | # - NODE_PATH=/install/node_modules 20 | 21 | backend: 22 | build: 23 | context: ./backend 24 | dockerfile: Dockerfile 25 | volumes: 26 | - ./backend:/code 27 | ports: 28 | - 8000:80 29 | environment: 30 | - DJANGO_SETTINGS_MODULE=dev_settings 31 | command: bash -c 'python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:80' 32 | 33 | compile: 34 | build: 35 | context: './infrastructure/worker' 36 | dockerfile: ./../compile.Dockerfile 37 | environment: 38 | - DOMAIN=localhost:8000 39 | 40 | game: 41 | build: 42 | context: './infrastructure/worker' 43 | dockerfile: ./../game.Dockerfile 44 | environment: 45 | - DOMAIN=localhost:8000 46 | -------------------------------------------------------------------------------- /engine/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /lib 3 | /javadoc 4 | /common-javadoc 5 | /src/battlecode-server.iml 6 | *.rms 7 | *.jar 8 | *.swp 9 | *.DS_Store 10 | /testreport 11 | *~ 12 | /instrumented 13 | .gradle 14 | \#.profile# 15 | .idea -------------------------------------------------------------------------------- /engine/AUTHORS: -------------------------------------------------------------------------------- 1 | The Battlecode software is copyright 2004-2016 by the authors. 2 | See COPYING for license terms. 3 | 4 | Current developers: 5 | Jamie Bloxham 6 | James Gilles 7 | Jessica Hyde 8 | Maxwell Mann 9 | Nicholas McCoy 10 | Elijah Stiles 11 | Aaron Vontell 12 | Gina Yuan 13 | 14 | Retired developers (since 2004): 15 | Alex Chen 16 | Adam Donovan 17 | Aaron Epstein 18 | Arash Ferdowsi 19 | Ben Frenkel 20 | Cyril Lan 21 | Cory Li 22 | David Lu 23 | Dan Gulotta 24 | David Greenspan 25 | Aaron Iba 26 | Amrik Kochhar 27 | Oleg Kozhushnyan 28 | Jasper Lin 29 | Matt Papi 30 | Nathan Pinsker 31 | Trevor Rundell 32 | Joel Stein 33 | Andrew Sugaya 34 | Aleks Tamarkin 35 | Steven Valdez 36 | Sherry Wu 37 | Yang Yang 38 | Min Zhang 39 | -------------------------------------------------------------------------------- /engine/circle.yml: -------------------------------------------------------------------------------- 1 | # Configuration for CircleCI. 2 | 3 | machine: 4 | java: 5 | version: 6 | oraclejdk8 7 | -------------------------------------------------------------------------------- /engine/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'engine' 2 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/common/BodyInfo.java: -------------------------------------------------------------------------------- 1 | package battlecode.common; 2 | 3 | /** 4 | * Stores information about a Object/Body in the game world 5 | */ 6 | public interface BodyInfo { 7 | 8 | /** 9 | * Returns the ID of this body. 10 | * 11 | * @return the ID of this body. 12 | */ 13 | int getID(); 14 | 15 | /** 16 | * Returns the center location of this body. 17 | * 18 | * @return the center location of this body. 19 | */ 20 | MapLocation getLocation(); 21 | 22 | /** 23 | * Returns whether this body is a robot. 24 | * 25 | * @return true if this body is a robot; false otherwise. 26 | */ 27 | boolean isRobot(); 28 | } 29 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/common/GameActionExceptionType.java: -------------------------------------------------------------------------------- 1 | package battlecode.common; 2 | 3 | /** 4 | * Enumerates the possible errors in GameWorld interactions that cause a GameActionException to be thrown. 5 | */ 6 | public enum GameActionExceptionType { 7 | 8 | /** 9 | * Internal error in the GameWorld engine. This is bad. 10 | */ 11 | INTERNAL_ERROR, 12 | /** 13 | * Indicates when a robot tries to perform an action for which it does not have enough resources. 14 | */ 15 | NOT_ENOUGH_RESOURCE, 16 | /** 17 | * Indicates when a robot tries to move into a non-empty location. 18 | */ 19 | CANT_MOVE_THERE, 20 | /** 21 | * Indicates when a robot tries to execute an action, but is not currently idle. 22 | */ 23 | IS_NOT_READY, 24 | /** 25 | * Indicates when a robot tries to sense a robot that no longer exists or is no longer 26 | * in this robot's sensor range. 27 | */ 28 | CANT_SENSE_THAT, 29 | /** 30 | * Indicates when a robot tries to perform an action on a location that is outside 31 | * its range. 32 | */ 33 | OUT_OF_RANGE, 34 | /** 35 | * Indicates when a robot tries to perform an action it can't. 36 | */ 37 | CANT_DO_THAT, 38 | /** 39 | * Indicates when a robot tries to perform an action on another robot, but there is 40 | * no suitable robot there. 41 | */ 42 | NO_ROBOT_THERE, 43 | /** 44 | * Indicates when round number is out of range. 45 | */ 46 | ROUND_OUT_OF_RANGE 47 | } 48 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/common/Team.java: -------------------------------------------------------------------------------- 1 | package battlecode.common; 2 | 3 | /** 4 | * This enum represents the team of a robot. A robot is on exactly one team. 5 | * Player robots are on either team A or team B. 6 | *

7 | * Since Team is a Java 1.5 enum, you can use it in switch 8 | * statements, it has all the standard enum methods (valueOf, 9 | * values, etc.), and you can safely use == for 10 | * equality tests. 11 | */ 12 | public enum Team { 13 | /** 14 | * Team A. 15 | */ 16 | A, 17 | /** 18 | * Team B. 19 | */ 20 | B, 21 | /** 22 | * Neutral robots. 23 | */ 24 | NEUTRAL; 25 | 26 | /** 27 | * Determines the team that is the opponent of this team. 28 | * 29 | * @return the opponent of this team. 30 | * 31 | * @battlecode.doc.costlymethod 32 | */ 33 | public Team opponent() { 34 | switch (this) { 35 | case A: 36 | return B; 37 | case B: 38 | return A; 39 | default: 40 | return NEUTRAL; 41 | } 42 | } 43 | 44 | /** 45 | * Returns whether a robot of this team is a player-controlled entity 46 | * (team A or team B). 47 | * 48 | * @return true a robot of this team is player-controlled; false otherwise. 49 | * 50 | * @battlecode.doc.costlymethod 51 | */ 52 | public boolean isPlayer() { 53 | return this == A || this == B; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/InstrumentationException.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter; 2 | 3 | /** 4 | * An exception used to indicate that there was a problem instrumenting a player (e.g., the player references a 5 | * disallowed class, or one if its classes can't be found). This must be an unchecked Exception, because it 6 | * has to be thrown in overriden methods. 7 | * 8 | * @author adamd 9 | */ 10 | public class InstrumentationException extends RuntimeException { 11 | 12 | public enum Type { 13 | ILLEGAL, 14 | MISSING 15 | } 16 | 17 | public final Type type; 18 | 19 | public InstrumentationException(Type type, String message) { 20 | super(message); 21 | this.type = type; 22 | } 23 | 24 | public InstrumentationException(Type type, String message, Throwable cause) { 25 | super(message, cause); 26 | this.type = type; 27 | } 28 | 29 | @Override 30 | public String getMessage() { 31 | return type + " " + super.getMessage(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/RobotDeathException.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter; 2 | 3 | /** 4 | * An exception used to kill robot threads when their robot dies in the game. In other words, when a robot 5 | * dies, a RobotDeathException is thrown in the robot's thread, and it propagates all the way up to RobotRunnable, 6 | * ending the robot's thread. This must be an unchecked exception, since it could be thrown anywhere in the player's code. 7 | * 8 | * @author adamd 9 | */ 10 | public class RobotDeathException extends VirtualMachineError { 11 | 12 | public RobotDeathException() { 13 | super(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/bytecode/resources/AllowedPackages.txt: -------------------------------------------------------------------------------- 1 | java/io 2 | java/lang 3 | java/lang/invoke 4 | java/math 5 | java/util 6 | java/util/function 7 | java/util/regex 8 | java/util/stream 9 | java/text 10 | battlecode/common 11 | scala 12 | scala/collection 13 | scala/collection/generic 14 | scala/collection/immutable 15 | scala/collection/interfaces 16 | scala/collection/mutable 17 | scala/collection/script 18 | scala/math 19 | scala/runtime 20 | scala/util 21 | scala/util/automata 22 | scala/util/continuations 23 | scala/util/control 24 | scala/util/grammar 25 | scala/util/logging 26 | scala/util/regexp 27 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/bytecode/resources/DisallowedClasses.txt: -------------------------------------------------------------------------------- 1 | java/io/File 2 | java/io/FileDescriptor 3 | java/io/FileInputStream 4 | java/io/FileOutputStream 5 | java/io/FilePermission 6 | java/io/FileReader 7 | java/io/FileWriter 8 | java/io/RandomAccessFile 9 | java/io/SerializablePermission 10 | java/lang/ClassLoader 11 | java/lang/Compiler 12 | java/lang/InheritableThreadLocal 13 | java/lang/Package 14 | java/lang/Process 15 | java/lang/ProcessBuilder 16 | java/lang/Runtime 17 | java/lang/RuntimePermission 18 | java/lang/SecurityManager 19 | java/lang/Thread 20 | java/lang/ThreadGroup 21 | java/lang/ThreadLocal 22 | java/lang/invoke/SwitchPoint 23 | java/lang/invoke/MethodHandleProxies 24 | java/util/Calendar 25 | java/util/Currency 26 | java/util/Date 27 | java/util/EventListener 28 | java/util/EventListenerProxy 29 | java/util/EventObject 30 | java/util/FormattableFlags 31 | java/util/Formatter 32 | java/util/GregorianCalendar 33 | java/util/ListResourceBundle 34 | java/util/Locale 35 | java/util/MissingResourceException 36 | java/util/Properties 37 | java/util/PropertyPermission 38 | java/util/PropertyResourceBundle 39 | java/util/ResourceBundle 40 | java/util/SimpleTimeZone 41 | java/util/TimeZone 42 | java/util/Timer 43 | java/util/TimerTask 44 | java/util/UUID 45 | java/util/WeakHashMap 46 | scala/Symbol 47 | scala/Symbol$ 48 | scala/runtime/MethodCache 49 | scala/util/DynamicVariable 50 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/inject/AtomicInteger.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.inject; 2 | 3 | @SuppressWarnings("unused") 4 | public class AtomicInteger { 5 | 6 | private int l; 7 | 8 | public AtomicInteger() { 9 | } 10 | 11 | public AtomicInteger(int x) { 12 | l = x; 13 | } 14 | 15 | public int get() { 16 | return l; 17 | } 18 | 19 | public void set(int x) { 20 | l = x; 21 | } 22 | 23 | public boolean compareAndSet(int expect, int update) { 24 | boolean b = (l == expect); 25 | if (b) l = update; 26 | return b; 27 | } 28 | 29 | public int incrementAndGet() { 30 | return ++l; 31 | } 32 | 33 | public int decrementAndGet() { 34 | return --l; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/inject/AtomicLong.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.inject; 2 | 3 | // Fake AtomicLong class, needed by java.util.Random. 4 | @SuppressWarnings("unused") 5 | public class AtomicLong { 6 | 7 | private long l; 8 | 9 | public AtomicLong() { 10 | } 11 | 12 | public AtomicLong(long x) { 13 | l = x; 14 | } 15 | 16 | public long get() { 17 | return l; 18 | } 19 | 20 | public void set(long x) { 21 | l = x; 22 | } 23 | 24 | public boolean compareAndSet(long expect, long update) { 25 | boolean b = (l == expect); 26 | if (b) l = update; 27 | return b; 28 | } 29 | 30 | public long incrementAndGet() { 31 | return ++l; 32 | } 33 | 34 | public long getAndIncrement() { 35 | return l++; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/inject/AtomicReference.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.inject; 2 | 3 | @SuppressWarnings("unused") 4 | public class AtomicReference { 5 | 6 | private V v; 7 | 8 | public AtomicReference() { 9 | } 10 | 11 | public AtomicReference(V w) { 12 | v = w; 13 | } 14 | 15 | public boolean compareAndSet(V e, V u) { 16 | if (v == e) { 17 | v = u; 18 | return true; 19 | } else 20 | return false; 21 | } 22 | 23 | public V get() { 24 | return v; 25 | } 26 | 27 | public V getAndSet(V w) { 28 | V vold = v; 29 | v = w; 30 | return vold; 31 | } 32 | 33 | public void lazySet(V w) { 34 | v = w; 35 | } 36 | 37 | public void set(V w) { 38 | v = w; 39 | } 40 | 41 | public String toString() { 42 | if (v == null) 43 | return "null"; 44 | else 45 | return v.toString(); 46 | } 47 | 48 | public boolean weakCompareAndSet(V e, V u) { 49 | return compareAndSet(e, u); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/inject/ConcurrentHashMap.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.inject; 2 | 3 | import java.util.Hashtable; 4 | import java.util.concurrent.ConcurrentMap; 5 | 6 | /** 7 | * ConcurrentMap implementation that isn't really concurrent. 8 | * Needed to instrument Clojure. 9 | */ 10 | @SuppressWarnings("unused") 11 | public class ConcurrentHashMap extends Hashtable implements ConcurrentMap { 12 | 13 | public V putIfAbsent(K key, V value) { 14 | if (!containsKey(key)) 15 | return put(key, value); 16 | else 17 | return get(key); 18 | } 19 | 20 | public boolean remove(Object key, Object value) { 21 | if (containsKey(key) && get(key).equals(value)) { 22 | remove(key); 23 | return true; 24 | } else return false; 25 | } 26 | 27 | public boolean replace(K key, V oldValue, V newValue) { 28 | if (containsKey(key) && get(key).equals(oldValue)) { 29 | put(key, newValue); 30 | return true; 31 | } else return false; 32 | } 33 | 34 | public V replace(K key, V value) { 35 | if (containsKey(key)) { 36 | return put(key, value); 37 | } else return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/inject/Thread.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.inject; 2 | 3 | import battlecode.instrumenter.InstrumentationException; 4 | 5 | import static battlecode.instrumenter.InstrumentationException.Type.ILLEGAL; 6 | 7 | @SuppressWarnings("unused") 8 | public class Thread extends java.lang.Thread { 9 | 10 | private static Thread INSTANCE = new Thread(false); 11 | 12 | private Thread(boolean b) { 13 | } 14 | 15 | public Thread() { 16 | throw new InstrumentationException(ILLEGAL, "You can't start threads; try using multiple robots."); 17 | } 18 | 19 | public Thread(Runnable r) { 20 | throw new InstrumentationException(ILLEGAL, "You can't start threads; try using multiple robots."); 21 | } 22 | 23 | public static Thread currentThread() { 24 | return INSTANCE; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/inject/Unsafe.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.inject; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * Do-nothing replacement for sun.misc.Unsafe. Used by Random. 7 | */ 8 | @SuppressWarnings("unused") 9 | public class Unsafe { 10 | 11 | private Unsafe() { 12 | } 13 | 14 | private static Unsafe instance = new Unsafe(); 15 | 16 | public static Unsafe getUnsafe() { 17 | return instance; 18 | } 19 | 20 | public long objectFieldOffset(Field f) { 21 | return 0; 22 | } 23 | 24 | public void putObjectVolatile(Object o, long offset, Object x) { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/profiler/ProfilerEvent.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.profiler; 2 | 3 | public class ProfilerEvent { 4 | private ProfilerEventType type; 5 | private int at; 6 | private int frameId; 7 | 8 | public ProfilerEvent(ProfilerEventType type, int at, int frameId) { 9 | this.type = type; 10 | this.at = at; 11 | this.frameId = frameId; 12 | } 13 | 14 | public ProfilerEventType getType() { 15 | return type; 16 | } 17 | 18 | public int getAt() { 19 | return at; 20 | } 21 | 22 | public int getFrameId() { 23 | return frameId; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/profiler/ProfilerEventType.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.profiler; 2 | 3 | public enum ProfilerEventType { 4 | OPEN("O"), CLOSE("C"); 5 | 6 | private final String value; 7 | 8 | ProfilerEventType(String value) { 9 | this.value = value; 10 | } 11 | 12 | public String getValue() { 13 | return value; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/instrumenter/stream/EOFInputStream.java: -------------------------------------------------------------------------------- 1 | package battlecode.instrumenter.stream; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | /** 7 | * Boring input stream. 8 | */ 9 | public class EOFInputStream extends InputStream { 10 | @Override 11 | public int read() throws IOException { 12 | throw new java.io.EOFException(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/schema/BodyType.java: -------------------------------------------------------------------------------- 1 | // automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | package battlecode.schema; 4 | 5 | /** 6 | * The possible types of things that can exist. 7 | * Note that bullets are not treated as bodies. 8 | */ 9 | public final class BodyType { 10 | private BodyType() { } 11 | /** 12 | * Enlightenment centers produce politicians, Muckrakers and slanderers and place bids 13 | *can be neutral until captured 14 | */ 15 | public static final byte ENLIGHTENMENT_CENTER = 0; 16 | /** 17 | * politicians use their influence to self destruct and capture other units 18 | */ 19 | public static final byte POLITICIAN = 1; 20 | /** 21 | * slanderers generate passive influence for the enlightenment center that created them 22 | * they turn into politicians at some point, and can only be identified by slanderers. 23 | */ 24 | public static final byte SLANDERER = 2; 25 | /** 26 | * have the ability to identify slanderers 27 | */ 28 | public static final byte MUCKRAKER = 3; 29 | 30 | public static final String[] names = { "ENLIGHTENMENT_CENTER", "POLITICIAN", "SLANDERER", "MUCKRAKER", }; 31 | 32 | public static String name(int e) { return names[e]; } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/schema/Vec.java: -------------------------------------------------------------------------------- 1 | // automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | package battlecode.schema; 4 | 5 | import java.nio.*; 6 | import java.lang.*; 7 | import java.util.*; 8 | import com.google.flatbuffers.*; 9 | 10 | @SuppressWarnings("unused") 11 | /** 12 | * A vector in two-dimensional space. Discrete space, of course. 13 | * Defaults to the 0 vector. 14 | */ 15 | public final class Vec extends Struct { 16 | public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; } 17 | public Vec __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 18 | 19 | public int x() { return bb.getInt(bb_pos + 0); } 20 | public int y() { return bb.getInt(bb_pos + 4); } 21 | 22 | public static int createVec(FlatBufferBuilder builder, int x, int y) { 23 | builder.prep(4, 8); 24 | builder.putInt(y); 25 | builder.putInt(x); 26 | return builder.offset(); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/server/GameState.java: -------------------------------------------------------------------------------- 1 | package battlecode.server; 2 | 3 | public enum GameState { 4 | RUNNING, 5 | DONE 6 | } 7 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/server/ServerState.java: -------------------------------------------------------------------------------- 1 | package battlecode.server; 2 | 3 | /** 4 | * Represents the state of a match in a running server. 5 | */ 6 | public enum ServerState { 7 | 8 | /** 9 | * The match is not ready for running yet. 10 | */ 11 | NOT_READY, 12 | 13 | /** 14 | * The match is ready to start running. 15 | */ 16 | READY, 17 | 18 | /** 19 | * The match is running. 20 | */ 21 | RUNNING, 22 | 23 | /** 24 | * The match is paused. 25 | */ 26 | PAUSED, 27 | 28 | /** 29 | * The match has finished running. 30 | */ 31 | FINISHED, 32 | 33 | /** 34 | * The match could not be run because the server experienced an error. 35 | */ 36 | ERROR 37 | } 38 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/server/Version.java: -------------------------------------------------------------------------------- 1 | package battlecode.server; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | 6 | /** 7 | * Utility class for determining the java version. 8 | * 9 | * @author james 10 | */ 11 | public class Version { 12 | /** 13 | * The version of battlecode. 14 | */ 15 | public final static String version; 16 | 17 | static { 18 | String readVersion; 19 | try (final BufferedReader r = new BufferedReader(new InputStreamReader( 20 | Version.class.getClassLoader().getResourceAsStream("battlecode-version")))) { 21 | readVersion = r.readLine(); 22 | } catch (Exception e) { 23 | System.err.println("Can't open version"); 24 | e.printStackTrace(); 25 | readVersion = "UNKNOWN"; 26 | } 27 | version = readVersion; 28 | } 29 | 30 | /** 31 | * @param args unused 32 | */ 33 | public static void main(String[] args) { 34 | System.out.println(version); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/util/TeamMapping.java: -------------------------------------------------------------------------------- 1 | package battlecode.util; 2 | 3 | import battlecode.common.Team; 4 | 5 | import java.util.EnumMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * Utility 10 | * 11 | * @author james 12 | */ 13 | public final class TeamMapping { 14 | private static final Map teamsToIds = new EnumMap<>(Team.class); 15 | static { 16 | teamsToIds.put(Team.NEUTRAL, (byte)0); 17 | teamsToIds.put(Team.A, (byte)1); 18 | teamsToIds.put(Team.B, (byte)2); 19 | } 20 | private static final Team[] idsToTeams = {Team.NEUTRAL, Team.A, Team.B}; 21 | 22 | /** 23 | * Get the team for a team ID 24 | */ 25 | public static Team team(byte id) { 26 | return idsToTeams[id]; 27 | } 28 | 29 | /** 30 | * Get the ID for a team 31 | */ 32 | public static byte id(Team team) { 33 | return teamsToIds.get(team); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/BuildMaps.java: -------------------------------------------------------------------------------- 1 | package battlecode.world; 2 | 3 | import battlecode.world.maps.*; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * Generate a map. 9 | */ 10 | public class BuildMaps { 11 | 12 | 13 | // don't change this!! 14 | public static final String outputDirectory = "engine/src/main/battlecode/world/resources/"; 15 | 16 | /** 17 | * @param args unused 18 | */ 19 | public static void main(String[] args) { 20 | MapTestSmall.main(args); 21 | Circle.main(args); 22 | Quadrants.main(args); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/DominationFactor.java: -------------------------------------------------------------------------------- 1 | package battlecode.world; 2 | 3 | /** 4 | * Determines roughly by how much the winning team won. 5 | */ 6 | public enum DominationFactor { 7 | /** 8 | * Win by all enemy robots being destroyed (early end). 9 | */ 10 | ANNIHILATED, 11 | /** 12 | * Win by more votes. 13 | */ 14 | MORE_VOTES, 15 | /** 16 | * Win by having more Enlightenment Centers (tiebreak 1). 17 | */ 18 | MORE_ENLIGHTENMENT_CENTERS, 19 | /** 20 | * Win by more total influence (tiebreak 2). 21 | */ 22 | MORE_INFLUENCE, 23 | /** 24 | * Win by coinflip (tiebreak 3). 25 | */ 26 | WON_BY_DUBIOUS_REASONS, 27 | } 28 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/GameStats.java: -------------------------------------------------------------------------------- 1 | package battlecode.world; 2 | 3 | import battlecode.common.Team; 4 | 5 | /** 6 | * Class to hold any game stats desired for a specific match 7 | * such as winner and domination factor 8 | */ 9 | public class GameStats { 10 | 11 | private Team winner; 12 | private DominationFactor dominationFactor; 13 | 14 | public GameStats() { 15 | this.winner = null; 16 | this.dominationFactor = null; 17 | } 18 | 19 | public void setWinner(Team t) { 20 | winner = t; 21 | } 22 | 23 | public void setDominationFactor(DominationFactor d) { 24 | dominationFactor = d; 25 | } 26 | 27 | public Team getWinner() { 28 | return winner; 29 | } 30 | 31 | public DominationFactor getDominationFactor() { 32 | return dominationFactor; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/control/NullControlProvider.java: -------------------------------------------------------------------------------- 1 | package battlecode.world.control; 2 | 3 | import battlecode.world.GameWorld; 4 | import battlecode.world.InternalRobot; 5 | 6 | /** 7 | * RobotControlProvider that does nothing. 8 | * 9 | * @author james 10 | */ 11 | public class NullControlProvider implements RobotControlProvider { 12 | @Override 13 | public void matchStarted(GameWorld world) {} 14 | 15 | @Override 16 | public void matchEnded() {} 17 | 18 | @Override 19 | public void robotSpawned(InternalRobot robot) {} 20 | 21 | @Override 22 | public void robotKilled(InternalRobot robot) {} 23 | 24 | @Override 25 | public void roundStarted() {} 26 | 27 | @Override 28 | public void runRobot(InternalRobot robot) {} 29 | 30 | @Override 31 | public void roundEnded() {} 32 | 33 | @Override 34 | public int getBytecodesUsed(InternalRobot robot) { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public boolean getTerminated(InternalRobot robot) { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/AmidstWe.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/AmidstWe.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Andromeda.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Andromeda.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Arena.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Arena.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/BadSnowflake.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/BadSnowflake.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/BattleCode.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/BattleCode.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/BattleCodeToo.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/BattleCodeToo.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/BlobWithLegs.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/BlobWithLegs.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Blotches.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Blotches.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Bog.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Bog.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Branches.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Branches.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/ButtonsAndBows.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/ButtonsAndBows.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/CToE.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/CToE.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Chevron.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Chevron.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Circles.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Circles.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Corridor.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Corridor.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Cow.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Cow.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/CowTwister.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/CowTwister.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/CringyAsF.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/CringyAsF.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/CrossStitch.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/CrossStitch.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/CrownJewels.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/CrownJewels.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/EggCarton.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/EggCarton.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/ExesAndOhs.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/ExesAndOhs.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Extensions.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Extensions.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/FindYourWay.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/FindYourWay.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/FiveOfHearts.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/FiveOfHearts.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Flawars.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Flawars.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/FrogOrBath.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/FrogOrBath.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/GetShrekt.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/GetShrekt.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Goldfish.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Goldfish.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Gridlock.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Gridlock.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/HappyBoba.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/HappyBoba.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/HexesAndOhms.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/HexesAndOhms.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Hourglass.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Hourglass.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Illusion.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Illusion.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/InaccurateBritishFlag.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/InaccurateBritishFlag.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/JerryIsEvil.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/JerryIsEvil.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Legends.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Legends.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Licc.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Licc.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/MainCampus.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/MainCampus.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Mario.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Mario.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Maze.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Maze.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Misdirection.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Misdirection.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Networking.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Networking.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/NextHouse.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/NextHouse.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/NoInternet.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/NoInternet.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/NotAPuzzle.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/NotAPuzzle.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/OneCallAway.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/OneCallAway.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/PaperWindmill.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/PaperWindmill.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Punctuation.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Punctuation.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Radial.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Radial.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Rainbow.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Rainbow.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Randomized.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Randomized.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Saturn.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Saturn.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/SeaFloor.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/SeaFloor.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Sediment.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Sediment.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/SlowMusic.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/SlowMusic.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Smile.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Smile.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Snowflake.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Snowflake.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/SpaceInvaders.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/SpaceInvaders.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Star.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Star.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Stonks.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Stonks.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Superposition.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Superposition.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Surprised.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Surprised.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/TheClientMapEditorIsSuperiorToGoogleSheetsEom.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/TheClientMapEditorIsSuperiorToGoogleSheetsEom.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/TheSnackThatSmilesBack.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/TheSnackThatSmilesBack.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/TicTacTie.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/TicTacTie.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Tiger.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Tiger.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/UnbrandedWordGame.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/UnbrandedWordGame.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/VideoGames.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/VideoGames.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/WhatISeeInMyDreams.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/WhatISeeInMyDreams.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Yoda.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Yoda.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Z.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Z.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/Zodiac.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/Zodiac.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/circle.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/circle.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/maptestsmall.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/maptestsmall.map21 -------------------------------------------------------------------------------- /engine/src/main/battlecode/world/resources/quadrants.map21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/main/battlecode/world/resources/quadrants.map21 -------------------------------------------------------------------------------- /engine/src/test/battlecode/common/DirectionTest.java: -------------------------------------------------------------------------------- 1 | package battlecode.common; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class DirectionTest { 8 | 9 | // TODO: write a bunch more of these 10 | 11 | // @Test 12 | // public void testBasic() { 13 | // final Direction north = new Direction(0, 1); 14 | // assertEquals(north.getDeltaX(0), 0, .00000001); 15 | // assertEquals(north.getDeltaY(1), 1, .00000001); 16 | // } 17 | } 18 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/common/MapLocationTest.java: -------------------------------------------------------------------------------- 1 | package battlecode.common; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class MapLocationTest { 8 | 9 | // TODO: write a bunch more of these 10 | 11 | @Test 12 | public void testConstructor() { 13 | MapLocation loc = new MapLocation(10123, -401823); 14 | assertEquals(loc.x, 10123); 15 | assertEquals(loc.y, -401823); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/resources/ValueA.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/test/battlecode/instrumenter/resources/ValueA.class -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/resources/ValueB.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/test/battlecode/instrumenter/resources/ValueB.class -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/resources/java.lang.Double.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/test/battlecode/instrumenter/resources/java.lang.Double.class -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/CallsMathRandom.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * @author james 5 | */ 6 | @SuppressWarnings("unused") 7 | public class CallsMathRandom { 8 | private static final double d = Math.random(); 9 | } 10 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/DoesntOverrideHashCode.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * Used to test hashCode instrumentation. 5 | * 6 | * @author james 7 | */ 8 | @SuppressWarnings("unused") 9 | public class DoesntOverrideHashCode { 10 | // We need to be able to make sure that calls to hashcode are instrumented correctly. 11 | public int getHashCode() { 12 | return this.hashCode(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/DoesntOverrideToString.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | @SuppressWarnings("unused") 4 | public class DoesntOverrideToString { 5 | public String getToString() { 6 | return this.toString(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/IllegalMethodReference.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | import java.util.Random; 4 | import java.util.function.Supplier; 5 | 6 | /** 7 | * @author james 8 | */ 9 | @SuppressWarnings("unused") 10 | public class IllegalMethodReference { 11 | // This is not allowed, since we can't currently implement it. 12 | Supplier randomSupplier = Random::new; 13 | } 14 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/LegalMethodReference.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | import java.util.Random; 4 | import java.util.function.Supplier; 5 | 6 | /** 7 | * @author james 8 | */ 9 | @SuppressWarnings("all") 10 | public class LegalMethodReference { 11 | // This is allowed, and hopefully won't be replaced with a method reference. 12 | private static final Supplier legalRandomSupplier = () -> new Random(); 13 | } 14 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/Nothing.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * @author james 5 | */ 6 | public class Nothing {} 7 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/Outer.java: -------------------------------------------------------------------------------- 1 | // Javac will move this into the correct package in the build output 2 | package instrumentertest; 3 | 4 | /** 5 | * Test loading of inner classes. 6 | * @author james 7 | */ 8 | @SuppressWarnings("unused") 9 | public class Outer { 10 | public static class Inner {} 11 | } 12 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/OverridesHashCode.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * @author james 5 | */ 6 | @SuppressWarnings("unused") 7 | public class OverridesHashCode { 8 | public int getHashCode() { 9 | return this.hashCode(); 10 | } 11 | @Override 12 | public int hashCode() { 13 | return 57; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/OverridesToString.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | @SuppressWarnings("unused") 4 | public class OverridesToString { 5 | public String getToString() { 6 | return this.toString(); 7 | } 8 | @Override 9 | public String toString() { 10 | return "foo"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/Reflection.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * @author james 5 | */ 6 | @SuppressWarnings("unused") 7 | public class Reflection { 8 | static { 9 | Reflection.class.getClassLoader(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/StringFormat.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * @author james 5 | */ 6 | @SuppressWarnings("unused") 7 | public class StringFormat { 8 | public static void run() { 9 | String s = String.format("Test %d", 1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/UsesEnumMap.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | import battlecode.common.Team; 4 | 5 | import java.util.EnumMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @author james 10 | */ 11 | @SuppressWarnings("unused") 12 | public class UsesEnumMap { 13 | // This is allowed, even though using a Class for anything else isn't. 14 | public static final Map enumMap = new EnumMap<>(Team.class); 15 | } 16 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/UsesLambda.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | import java.util.BitSet; 4 | import java.util.Comparator; 5 | import java.util.Scanner; 6 | import java.util.function.Predicate; 7 | 8 | /** 9 | * @author james 10 | */ 11 | @SuppressWarnings("unused") 12 | public class UsesLambda { 13 | public static void run() { 14 | Predicate isNullObjectPredicate = o -> o == null; 15 | 16 | isNullObjectPredicate.test("Hi!"); 17 | isNullObjectPredicate.test(null); 18 | 19 | Comparator alwaysTheSame = (a, b) -> 0; 20 | 21 | alwaysTheSame.compare("Hi", 12345); 22 | alwaysTheSame.compare(null, null); 23 | 24 | // Classes that use lambdas internally 25 | BitSet s = new BitSet(27); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/instrumentertest/UsesThrowable.java: -------------------------------------------------------------------------------- 1 | package instrumentertest; 2 | 3 | /** 4 | * @author james 5 | */ 6 | @SuppressWarnings("unused") 7 | public class UsesThrowable { 8 | public static void run() { 9 | Throwable t = new Exception(); 10 | t.printStackTrace(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/shared/SharedUtility.java: -------------------------------------------------------------------------------- 1 | package shared; 2 | 3 | /** 4 | * @author james 5 | */ 6 | public class SharedUtility { 7 | public static int theNumberSeven() { 8 | return 7; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayeractions/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayeractions; 2 | 3 | import battlecode.common.*; 4 | 5 | /** 6 | * A RobotPlayer for testing that uses all of the methods in RobotController. 7 | * 8 | * @author james 9 | */ 10 | @SuppressWarnings("unused") 11 | public class RobotPlayer { 12 | public static void run(RobotController rc) throws GameActionException { 13 | rc.resign(); 14 | rc.senseNearbyRobots(); 15 | 16 | System.out.println("I shouldn't overflow!"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerarray/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerarray; 2 | 3 | import battlecode.common.GameActionException; 4 | import battlecode.common.RobotController; 5 | 6 | /** 7 | * @author pear0 (William Gulian) 8 | */ 9 | public class RobotPlayer { 10 | public static void run(RobotController rc) throws GameActionException { 11 | 12 | RobotPlayer[] objects = new RobotPlayer[2]; 13 | for (RobotPlayer o : objects) { 14 | } 15 | 16 | while (true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerarraybytecode/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerarraybytecode; 2 | 3 | import battlecode.common.RobotController; 4 | import battlecode.common.Clock; 5 | 6 | /** 7 | * @author jamie 8 | */ 9 | public class RobotPlayer { 10 | @SuppressWarnings("unused") 11 | public static void run(RobotController rc) { 12 | int arrayLength = 2; 13 | while (arrayLength <= 16) { 14 | Clock.yield(); 15 | byte[] b = new byte[arrayLength]; 16 | Clock.yield(); 17 | arrayLength *= 2; 18 | } 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerbytecode/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerbytecode; 2 | 3 | import battlecode.common.RobotController; 4 | 5 | /** 6 | * @author james 7 | */ 8 | public class RobotPlayer { 9 | @SuppressWarnings("unused") 10 | public static void run(RobotController rc) { 11 | byte[] b = new byte[1000]; 12 | System.arraycopy(b, 0, b, 0, 1000); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerbytecodekotlin/RobotPlayer.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("RobotPlayer") 2 | @file:Suppress("PackageDirectoryMismatch") 3 | 4 | package testplayerbytecodekotlin 5 | 6 | import battlecode.common.RobotController 7 | 8 | fun run(@Suppress("UNUSED_PARAMETER") rc: RobotController) { 9 | 10 | (1..1000).toList() 11 | 12 | } -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerclock/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerclock; 2 | 3 | import battlecode.common.Clock; 4 | import battlecode.common.Direction; 5 | import battlecode.common.GameActionException; 6 | import battlecode.common.RobotController; 7 | 8 | /** 9 | * @author james 10 | */ 11 | public class RobotPlayer { 12 | public static void run(RobotController rc) throws GameActionException { 13 | Clock.yield(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerdebug/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerdebug; 2 | 3 | import battlecode.common.RobotController; 4 | 5 | /** 6 | * @author james 7 | */ 8 | public class RobotPlayer { 9 | public static void run(RobotController rc) { 10 | debug_recurse(); 11 | } 12 | 13 | public static void debug_recurse() { 14 | debug_useLotsOfBytecode(); 15 | } 16 | 17 | public static void debug_useLotsOfBytecode() { 18 | int[] i = new int[1000]; 19 | System.arraycopy(i, 0, i, 0, 1000); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerempty/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | // Javac will move this into the correct package in the build output 2 | package testplayerempty; 3 | 4 | import battlecode.common.RobotController; 5 | 6 | /** 7 | * A RobotPlayer for testing that does nothing. 8 | * 9 | * @author james 10 | */ 11 | @SuppressWarnings("unused") 12 | public class RobotPlayer { 13 | public static void run(RobotController r) throws Exception {} 14 | } 15 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerloopforever/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerloopforever; 2 | 3 | import battlecode.common.RobotController; 4 | 5 | /** 6 | * @author james 7 | */ 8 | public class RobotPlayer { 9 | public static void run(RobotController rc) { 10 | while (true) {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayermultiarraybytecode/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayermultiarraybytecode; 2 | 3 | import battlecode.common.RobotController; 4 | import battlecode.common.Clock; 5 | 6 | /** 7 | * @author jamie 8 | */ 9 | public class RobotPlayer { 10 | @SuppressWarnings("unused") 11 | public static void run(RobotController rc) { 12 | int x = 2; 13 | int y = 3; 14 | int z = 4; 15 | while (x <= 16) { 16 | Clock.yield(); 17 | byte[][][][] b = new byte[x][y][z][0]; 18 | Clock.yield(); 19 | x *= 2; 20 | y *= 3; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayernodebug/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayernodebug; 2 | 3 | import battlecode.common.RobotController; 4 | 5 | /** 6 | * @author james 7 | */ 8 | public class RobotPlayer { 9 | @SuppressWarnings("unused") 10 | public static void run(RobotController rc) { 11 | boolean[] debugContainsTrue = {false}; 12 | 13 | System.out.println(debugContainsTrue); 14 | System.out.println(debugContainsTrue[0]); 15 | 16 | debug_setTrue(debugContainsTrue); 17 | 18 | System.out.println(debugContainsTrue); 19 | System.out.println(debugContainsTrue[0]); 20 | 21 | if (debugContainsTrue[0]) { 22 | // loop forever 23 | while (true); 24 | } 25 | } 26 | 27 | public static void debug_setTrue(boolean[] param) { 28 | param[0] = true; 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerstatic/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerstatic; 2 | 3 | import battlecode.common.Clock; 4 | import battlecode.common.RobotController; 5 | 6 | /** 7 | * @author james 8 | */ 9 | public class RobotPlayer { 10 | static { 11 | Clock.yield(); 12 | } 13 | 14 | @SuppressWarnings("unused") 15 | public static void run(RobotController rc) { 16 | // Immediately return 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayersystem/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayersystem; 2 | 3 | import battlecode.common.RobotController; 4 | 5 | /** 6 | * @author james 7 | */ 8 | public class RobotPlayer { 9 | @SuppressWarnings("unused") 10 | public static void run(RobotController rc) { 11 | 12 | String shouldTerminate = System.getProperty("bc.testing.should.terminate"); 13 | if (shouldTerminate == null || !shouldTerminate.equals("true")) { 14 | // loop forever 15 | while (true); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayersystemout/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayersystemout; 2 | 3 | import battlecode.common.RobotController; 4 | 5 | import java.io.PrintStream; 6 | 7 | /** 8 | * @author james 9 | */ 10 | public class RobotPlayer { 11 | public static void run(RobotController rc) { 12 | Class k = System.class; 13 | PrintStream s = System.out; 14 | System.out.println("I LOVE MEMES"); 15 | System.out.println("this shouldn't have a header"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/instrumenter/sample/testplayerusesshared/RobotPlayer.java: -------------------------------------------------------------------------------- 1 | package testplayerusesshared; 2 | 3 | import battlecode.common.GameActionException; 4 | import battlecode.common.RobotController; 5 | import shared.SharedUtility; 6 | 7 | /** 8 | * @author james 9 | */ 10 | public class RobotPlayer { 11 | @SuppressWarnings("unused") 12 | public static void run(RobotController rc) throws GameActionException { 13 | // rc.broadcast(0, SharedUtility.theNumberSeven()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/world/IDGeneratorTest.java: -------------------------------------------------------------------------------- 1 | package battlecode.world; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.BitSet; 6 | 7 | import static org.junit.Assert.assertFalse; 8 | 9 | /** 10 | * @author james 11 | */ 12 | public class IDGeneratorTest { 13 | @Test 14 | public void testIDGeneratorNoDuplicates() { 15 | BitSet seen = new BitSet(IDGenerator.ID_BLOCK_SIZE * 2); 16 | IDGenerator gen = new IDGenerator(0); 17 | 18 | for (int i = 0; i < IDGenerator.ID_BLOCK_SIZE * 2; i++) { 19 | int nextID = gen.nextID(); 20 | 21 | assertFalse(seen.get(nextID)); 22 | 23 | seen.set(nextID, true); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /engine/src/test/battlecode/world/resources/clearMap.map20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/engine/src/test/battlecode/world/resources/clearMap.map20 -------------------------------------------------------------------------------- /example-bots/.gitignore: -------------------------------------------------------------------------------- 1 | /lib 2 | /build 3 | /battlecode-player.jar 4 | .DS_Store 5 | /proguard 6 | *~ 7 | .gradle 8 | -------------------------------------------------------------------------------- /example-bots/README.md: -------------------------------------------------------------------------------- 1 | # Example Bots 2 | 3 | These bots are example bots for testing the game implementation. There should be lots of bots for different edge cases here. 4 | 5 | Note that this is NOT where we will do internal playtesting — anything in here will be open for all competitors to see, and we don't want them to see our really good internal test bots. 6 | -------------------------------------------------------------------------------- /example-bots/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example-bots' 2 | -------------------------------------------------------------------------------- /example-bots/src/test/nothingbot/Sanity.java: -------------------------------------------------------------------------------- 1 | package nothingbot; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * Test that the testing infrastructure works. 9 | * 10 | * Hooraaay. 11 | * 12 | * @author james 13 | */ 14 | public class Sanity { 15 | @Test 16 | public void testSanity() { 17 | assertEquals(1, 1); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /frontend/.env.development: -------------------------------------------------------------------------------- 1 | THIS_URL=http://localhost:3000 2 | REACT_APP_BACKEND_URL=http://localhost:8000 3 | REACT_APP_REPLAY_URL=https://2021.battlecode.org 4 | -------------------------------------------------------------------------------- /frontend/.env.production: -------------------------------------------------------------------------------- 1 | THIS_URL=https://2021.battlecode.org 2 | REACT_APP_BACKEND_URL=https://2021.battlecode.org 3 | REACT_APP_REPLAY_URL=https://2021.battlecode.org 4 | -------------------------------------------------------------------------------- /frontend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: "airbnb", 3 | parser: "babel-eslint", 4 | 5 | env: { 6 | browser: true 7 | }, 8 | rules: { 9 | "react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }] 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /frontend/Dockerfile.dev: -------------------------------------------------------------------------------- 1 | 2 | FROM node:10.16-alpine 3 | 4 | # RUN mkdir /install 5 | # COPY package.json /install 6 | # RUN cd /install && npm install 7 | 8 | RUN mkdir /frontend 9 | WORKDIR /frontend 10 | 11 | # start the app 12 | EXPOSE 3000 13 | # CMD ["npm", "run", "startx"] 14 | # the reason we're doing npm install here is because we then can use 15 | # the mounted node_modules and keep package_lock nicely in version control 16 | CMD npm install && npm run startx 17 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battlecode-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "homepage": "https://2021.battlecode.org", 6 | "devDependencies": { 7 | "react-scripts": "^3.3.0" 8 | }, 9 | "dependencies": { 10 | "ace-builds": "^1.3.3", 11 | "jquery": "^3.4.1", 12 | "js-cookie": "^2.2.0", 13 | "moment": "^2.24.0", 14 | "pixi.js": "^4.8.4", 15 | "rc-slider": "^8.6.4", 16 | "react": "^16.4.0", 17 | "react-dom": "^16.12.0", 18 | "react-dropzone": "^8.0.3", 19 | "react-floater": "^0.7.2", 20 | "react-pixi-fiber": "^0.7.0", 21 | "react-popout": "^1.0.1", 22 | "react-router": "^4.3.1", 23 | "react-router-dom": "^4.3.1", 24 | "styled-components": "^4.1.3", 25 | "superagent": "^4.1.0", 26 | "vm2": "^3.6.3" 27 | }, 28 | "scripts": { 29 | "startx": "BROWSER=none react-scripts start", 30 | "start": "react-scripts start", 31 | "build": "rm -rf build && react-scripts build", 32 | "buildnogame": "rm -rf build && rm -rf public/out && rm -rf public/javadoc && rm -rf public/specs.html && react-scripts build", 33 | "test": "react-scripts test --env=jsdom", 34 | "eject": "react-scripts eject" 35 | }, 36 | "browserslist": [ 37 | ">0.2%", 38 | "not dead", 39 | "not ie <= 11", 40 | "not op_mini all" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /frontend/public/assets/fonts/Pe-icon-7-stroke.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/fonts/Pe-icon-7-stroke.eot -------------------------------------------------------------------------------- /frontend/public/assets/fonts/Pe-icon-7-stroke.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/fonts/Pe-icon-7-stroke.ttf -------------------------------------------------------------------------------- /frontend/public/assets/fonts/Pe-icon-7-stroke.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/fonts/Pe-icon-7-stroke.woff -------------------------------------------------------------------------------- /frontend/public/assets/img/castle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/castle.png -------------------------------------------------------------------------------- /frontend/public/assets/img/church.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/church.png -------------------------------------------------------------------------------- /frontend/public/assets/img/crusader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/crusader.png -------------------------------------------------------------------------------- /frontend/public/assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/favicon.png -------------------------------------------------------------------------------- /frontend/public/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/logo.png -------------------------------------------------------------------------------- /frontend/public/assets/img/pilgrim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/pilgrim.png -------------------------------------------------------------------------------- /frontend/public/assets/img/preacher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/preacher.png -------------------------------------------------------------------------------- /frontend/public/assets/img/prophet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/prophet.png -------------------------------------------------------------------------------- /frontend/public/assets/img/s_castle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/s_castle.png -------------------------------------------------------------------------------- /frontend/public/assets/img/s_church.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/s_church.png -------------------------------------------------------------------------------- /frontend/public/assets/img/s_crusader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/s_crusader.png -------------------------------------------------------------------------------- /frontend/public/assets/img/s_pilgrim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/s_pilgrim.png -------------------------------------------------------------------------------- /frontend/public/assets/img/s_preacher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/s_preacher.png -------------------------------------------------------------------------------- /frontend/public/assets/img/s_prophet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/s_prophet.png -------------------------------------------------------------------------------- /frontend/public/assets/img/voyager_vision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/assets/img/voyager_vision.png -------------------------------------------------------------------------------- /frontend/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/favicon.png -------------------------------------------------------------------------------- /frontend/public/favicon_bc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/public/favicon_bc.png -------------------------------------------------------------------------------- /frontend/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/frontend/screenshot.png -------------------------------------------------------------------------------- /frontend/src/components/paginationControl.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | class PaginationControl extends Component { 4 | render() { 5 | const { props } = this; 6 | 7 | if (!props.pageLimit || props.pageLimit<= 1) { 8 | return null; 9 | }; 10 | 11 | const items = []; 12 | const isFirst = props.page === 1; 13 | const isLast = props.page === props.pageLimit; 14 | 15 | items.push( 16 |
  • 17 | props.onPageClick(props.page - 1)}>Previous 18 |
  • 19 | ); 20 | 21 | 22 | for (let i = 1; i <= props.pageLimit; i++) { 23 | items.push( 24 |
  • 25 | props.onPageClick(i)}>{i} 26 |
  • 27 | ) 28 | } 29 | 30 | items.push( 31 |
  • 32 | props.onPageClick(props.page + 1)}>Next 33 |
  • 34 | ); 35 | 36 | return ( 37 |
      38 | {items} 39 |
    40 | ) 41 | } 42 | } 43 | 44 | export default PaginationControl; -------------------------------------------------------------------------------- /frontend/src/components/updateCard.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | class UpdateCard extends Component { 4 | /* 5 | a card that displays the time when its content was last updated 6 | default is to just show "time when it loaded" which is not automatically 7 | updated/so not really ideal 8 | */ 9 | 10 | constructor(props) { 11 | super(props); 12 | this.state = {'update_date': new Date()}; 13 | } 14 | 15 | timeSince() { 16 | var seconds = Math.floor((new Date() - this.state.update_date) / 1000); 17 | 18 | var interval = Math.floor(seconds / 86400); 19 | if (interval > 1) return "Updated " + interval + " days ago."; 20 | interval = Math.floor(seconds / 3600); 21 | if (interval > 1) return "Updated " + interval + " hours ago."; 22 | interval = Math.floor(seconds / 60); 23 | if (interval > 1) return "Updated " + interval + " minutes ago."; 24 | //if (seconds <= 15) return "Just updated." 25 | return "Updated " + Math.floor(seconds) + " seconds ago."; 26 | } 27 | 28 | getFooter() { 29 | return( 30 |
    31 |
    32 |
    33 | { this.timeSince() } 34 |
    35 |
    36 | ) 37 | } 38 | } 39 | 40 | export default UpdateCard -------------------------------------------------------------------------------- /frontend/src/components/userCard.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Avatar from '../components/avatar'; 3 | 4 | 5 | class UserCard extends Component { 6 | render () { 7 | const user = this.props.user 8 | const staff_msg = user.is_staff ? ( | ) : null 9 | return ( 10 |
    11 |
    12 |
    13 |
    14 |
    15 | 16 |

    {user.first_name + " " + user.last_name}
    {user.username} { staff_msg }

    17 |
    18 |
    19 |

    {user.bio}

    20 |
    21 |
    22 | ) 23 | } 24 | } 25 | 26 | export default UserCard 27 | 28 | 29 | -------------------------------------------------------------------------------- /frontend/src/footer.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { NavLink } from 'react-router-dom'; 3 | 4 | class Footer extends Component { 5 | render() { 6 | return ( 7 |
    8 |
    9 | 23 |

    24 | © {new Date().getFullYear()} MIT Battlecode. 25 |

    26 |
    27 |
    28 | ); 29 | } 30 | } 31 | 32 | export default Footer; 33 | -------------------------------------------------------------------------------- /frontend/src/views/VerifyUser.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import Api from '../api'; 4 | 5 | class VerifyUser extends Component { 6 | state = { 7 | message: '', 8 | success: false, 9 | } 10 | 11 | componentDidMount() { 12 | Api.verifyAccount('', this.callback); 13 | } 14 | 15 | callback = (data, success) => { 16 | if (success) { 17 | this.setState({ success, message: 'Your email is now verified' }); 18 | } else { 19 | this.setState({ message: data.status }); 20 | } 21 | } 22 | 23 | render() { 24 | const { message, success } = this.state; 25 | return ( 26 |
    27 | {message} 28 |
    29 | ); 30 | } 31 | } 32 | 33 | 34 | export default VerifyUser; 35 | -------------------------------------------------------------------------------- /frontend/src/views/countdown.css: -------------------------------------------------------------------------------- 1 | .Countdown{ 2 | margin: 10px auto; 3 | padding-bottom: 20px; 4 | } 5 | 6 | .Countdown-col{ 7 | display: inline-block; 8 | } 9 | 10 | .Countdown-col-element{ 11 | display: inline-block; 12 | margin: 0 20px; 13 | display: flex; 14 | flex-direction: column; 15 | } 16 | 17 | .Countdown-col-element strong{ 18 | font-size: 2em; 19 | } 20 | 21 | .countdown-container { 22 | text-align: center; 23 | } -------------------------------------------------------------------------------- /frontend/src/views/not_found.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | class NotFound extends Component { 4 | constructor(props) { 5 | super() 6 | this.state = { 7 | pawn: '♟️' 8 | } 9 | } 10 | 11 | render() { 12 | const pawnStyle = { 13 | paddingBottom: "0", 14 | fontSize: "100px", 15 | marginBottom: "-30px", 16 | } 17 | 18 | // display one of three random soup emojis :) 19 | // if (!this.state.soup) { 20 | // const rand = Math.floor(Math.random() * 3) 21 | // let soup_emoji = "" 22 | // switch (rand) { 23 | // case 0: 24 | // soup_emoji = "🍲" 25 | // break 26 | // case 1: 27 | // soup_emoji = "🥘" 28 | // break 29 | // default: 30 | // soup_emoji = "🍜" 31 | 32 | // } 33 | 34 | // this.setState({soup: soup_emoji}) 35 | // } 36 | 37 | 38 | return ( 39 |
    40 |

    {this.state.pawn}

    41 |

    404 error

    42 |
    Sorry, we couldn't find the page you were looking for!
    43 |
    44 | ); 45 | } 46 | } 47 | 48 | export default NotFound; -------------------------------------------------------------------------------- /frontend/src/views/staff.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | class AddCard extends Component { 4 | render() { 5 | return ( 6 |
    7 |
    8 |

    i am a card

    9 |
    10 |
    11 | ) 12 | } 13 | } 14 | 15 | class Staff extends Component { 16 | render() { 17 | return ( 18 |
    19 |
    20 | 21 |
    22 |

    Under construction!

    23 |
    24 | 25 |
    26 |
    27 | ) 28 | // return ( 29 | //
    30 | //
    31 | 32 | //
    33 | //
    34 | //
    35 | //
    36 | // 37 | //
    38 | //
    39 | //
    40 | //
    41 | //
    42 | //
    43 | // 44 | //
    45 | //
    46 | //
    47 | //
    48 | 49 | //
    50 | //

    rankings go here

    51 | //
    52 | 53 | //
    54 | //
    55 | // ) 56 | } 57 | } 58 | 59 | export default Staff -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # modify this file to change project properties 2 | teamA=examplefuncsplayer 3 | teamB=examplefuncsplayer 4 | maps=maptestsmall 5 | profilerEnabled=false 6 | source=src 7 | mapLocation=maps 8 | release_version=2021.3.0.5 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /infrastructure/.gitignore: -------------------------------------------------------------------------------- 1 | dist/* 2 | .vscode/* 3 | build/* 4 | matches/* 5 | gcloud-key.json -------------------------------------------------------------------------------- /infrastructure/compile.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bc21-worker 2 | 3 | COPY app/compile_server.py app/ 4 | CMD python3 /app/compile_server.py 5 | -------------------------------------------------------------------------------- /infrastructure/env.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3 2 | ENV BC_DB_USERNAME database_admin 3 | ENV BC_DB_PASSWORD ??? 4 | ENV DOMAIN https://2021.battlecode.org -------------------------------------------------------------------------------- /infrastructure/game.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bc21-worker 2 | 3 | COPY app/game_server.py app/ 4 | # COPY maps box/maps/ 5 | CMD python3 /app/game_server.py 6 | -------------------------------------------------------------------------------- /infrastructure/matcher/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | import logging 3 | 4 | # Configure logging format 5 | 6 | logging.basicConfig(format='%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s') 7 | logging.getLogger().setLevel(logging.INFO) 8 | 9 | 10 | # Constants, parameters and configurations 11 | DOMAIN = os.getenv('DOMAIN') 12 | 13 | API_AUTHENTICATE = f'{DOMAIN}/auth/token/' 14 | API_USERNAME = os.getenv('BC_DB_USERNAME') 15 | API_PASSWORD = os.getenv('BC_DB_PASSWORD') 16 | 17 | API_SCRIM_LIST = f'{DOMAIN}/api/match/scrimmage_list/' 18 | API_ENQUEUE = f'{DOMAIN}/api/match/enqueue/' 19 | 20 | NUM_WORKER_THREADS = 10 21 | 22 | TOURNAMENT_WORKER_TIMEOUT = 15 23 | 24 | def api_match_status(gameid): 25 | """ 26 | Returns the API link for obtaining the status of a scrimmage 27 | gameid: the ID of the game 28 | """ 29 | return f'{DOMAIN}/api/0/scrimmage/{gameid}/' 30 | -------------------------------------------------------------------------------- /infrastructure/matcher/maps.json: -------------------------------------------------------------------------------- 1 | { 2 | "Round 1 (Winners)": [ 3 | "circle","maptestsmall","quadrants" 4 | ], 5 | "Round 1 (Losers)": [ 6 | "maptestsmall","quadrants","circle" 7 | ], 8 | "Round 2 (Winners)": [ 9 | "quadrants","circle","maptestsmall" 10 | ], 11 | "Round 2 (Losers A)": [ 12 | "circle","maptestsmall","quadrants" 13 | ], 14 | "Round 3": [ 15 | "maptestsmall","quadrants","circle" 16 | ], 17 | "Round 4 (if needed)": [ 18 | "quadrants","circle","maptestsmall" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /infrastructure/matcher/team_names: -------------------------------------------------------------------------------- 1 | asdfsddtjggyftawehjjhsrsfghgsdf 2 | testteam the redux 3 | Teh Devs -------------------------------------------------------------------------------- /infrastructure/matcher/team_pk: -------------------------------------------------------------------------------- 1 | 1883 2 | 1810 3 | 1790 4 | -------------------------------------------------------------------------------- /infrastructure/matcher/util.py: -------------------------------------------------------------------------------- 1 | from config import * 2 | 3 | import requests 4 | 5 | def get_api_auth_token(): 6 | """Retrieves an API token for sending authenticated requests to the backend server""" 7 | try: 8 | response = requests.post(url=API_AUTHENTICATE, data={ 9 | 'username': API_USERNAME, 10 | 'password': API_PASSWORD 11 | }) 12 | response.raise_for_status() 13 | return response.json()['access'] 14 | except: 15 | logging.error('Could not obtain API authentication token') 16 | 17 | def enqueue(match_params): 18 | """Enqueues a match, returning the match id on success""" 19 | try: 20 | auth_token = get_api_auth_token() 21 | response = requests.post(url=API_ENQUEUE, data=match_params, headers={ 22 | 'Authorization': 'Bearer {}'.format(auth_token) 23 | }) 24 | response.raise_for_status() 25 | return response.json()["message"] 26 | except: 27 | logging.error('Could not enqueue match: {}'.format(match_params)) 28 | -------------------------------------------------------------------------------- /infrastructure/scrimmage.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bc21-env 2 | 3 | # Install software dependencies 4 | RUN pip3 install --upgrade \ 5 | apscheduler \ 6 | requests 7 | 8 | COPY config.py util.py scrimmage.py app/ 9 | CMD python3 /app/scrimmage.py 10 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/.gitignore: -------------------------------------------------------------------------------- 1 | /data/* 2 | !/data/0-example 3 | !/data/1-sprint1 4 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/bracketlib.py: -------------------------------------------------------------------------------- 1 | ../matcher/bracketlib.py -------------------------------------------------------------------------------- /infrastructure/tournament-util/config.py: -------------------------------------------------------------------------------- 1 | ../matcher/config.py -------------------------------------------------------------------------------- /infrastructure/tournament-util/csv_to_files.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # USAGE: csv_to_files.py CSV_FILE 3 | 4 | import sys, json 5 | 6 | filename = sys.argv[1] 7 | 8 | with open(filename, 'r') as f: 9 | with open('team_pk', 'w') as g: 10 | with open('team_names', 'w') as h: 11 | f.readline() # Skip the title row 12 | for line in f.readlines(): 13 | team_id, team_name, team_score = line.split(',') 14 | g.write(team_id+'\n') 15 | h.write(team_name+'\n') 16 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/data/0-example/maps.json: -------------------------------------------------------------------------------- 1 | { 2 | "Round 1 (Winners)": [ 3 | "Egg", 4 | "Climb", 5 | "DoesNotExist" 6 | ], 7 | "Round 1 (Losers)": [ 8 | "Waves", 9 | "Toothpaste", 10 | "Hourglass" 11 | ], 12 | "Round 2 (Winners)": [ 13 | "NoU", 14 | "Pokeball", 15 | "Canyon" 16 | ], 17 | "Round 2 (Losers A)": [ 18 | "Swirl", 19 | "Spiral", 20 | "Constriction" 21 | ], 22 | "Round 3": [ 23 | "Hypnosis", 24 | "ALandDivided", 25 | "CentralLake" 26 | ], 27 | "Round 4 (if needed)": [ 28 | "CPU", 29 | "Diagonals", 30 | "Maze" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/data/0-example/parsed.txt: -------------------------------------------------------------------------------- 1 | testteam the redux -vs- Teh Dev | maptestsmall bluewon replay fc87d381b294fb59e34fdd6f3e6370 2 | Teh Dev -vs- testteam the redux | quadrants bluewon replay 94962a605adad55b5e9d79cc3cc713 3 | asdfsddtjggyftawehjjhsrsfghgsdf -vs- Teh Dev | circle bluewon replay 9c1d36955c80048c781a29ad80d522 4 | asdfsddtjggyftawehjjhsrsfghgsdf -vs- testteam the redux | circle bluewon replay 06097511c49d99846fef94190dab4e 5 | Teh Dev -vs- testteam the redux | circle bluewon replay 051411ba85be3f8798aff26993a7e3 6 | testteam the redux -vs- Teh Dev | circle bluewon replay 41a8169ac95d36565c10c684445622 7 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/data/0-example/results.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | [ 4 | "testteam the redux", 5 | "Teh Dev", 6 | "maptestsmall", 7 | 2, 8 | "fc87d381b294fb59e34fdd6f3e6370" 9 | ], 10 | [ 11 | "Teh Dev", 12 | "testteam the redux", 13 | "quadrants", 14 | 2, 15 | "94962a605adad55b5e9d79cc3cc713" 16 | ] 17 | ], 18 | [ 19 | [ 20 | "asdfsddtjggyftawehjjhsrsfghgsdf", 21 | "Teh Dev", 22 | "circle", 23 | 2, 24 | "9c1d36955c80048c781a29ad80d522" 25 | ] 26 | ], 27 | [ 28 | [ 29 | "asdfsddtjggyftawehjjhsrsfghgsdf", 30 | "testteam the redux", 31 | "circle", 32 | 2, 33 | "06097511c49d99846fef94190dab4e" 34 | ] 35 | ], 36 | [ 37 | [ 38 | "Teh Dev", 39 | "testteam the redux", 40 | "circle", 41 | 2, 42 | "051411ba85be3f8798aff26993a7e3" 43 | ] 44 | ], 45 | [ 46 | [ 47 | "testteam the redux", 48 | "Teh Dev", 49 | "circle", 50 | 2, 51 | "41a8169ac95d36565c10c684445622" 52 | ] 53 | ] 54 | ] -------------------------------------------------------------------------------- /infrastructure/tournament-util/data/0-example/team_names: -------------------------------------------------------------------------------- 1 | 914 2 | 917 3 | 919 4 | 920 5 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/data/0-example/team_pk: -------------------------------------------------------------------------------- 1 | arvid 2 | 2:40 AM 3 | teh devs 4 | database_team 5 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/match_list.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys, json, requests 4 | 5 | with open(sys.argv[1], 'r') as f: 6 | replays = json.loads(f.read()) 7 | 8 | for match in replays: 9 | if match is not None: 10 | for game in match: 11 | if game[3] == 1: 12 | # winner = 'redwon' 13 | winner = game[0] 14 | elif game[3] == 2: 15 | # winner = 'bluewon' 16 | winner = game[1] 17 | else: 18 | raise ValueError('Invalid winner: {}'.format(game[3])) 19 | # print ('{} -vs- {}'.format( 20 | # game[0], # Red team 21 | # game[1])) # Blue team 22 | # print('winner: {}'.format( 23 | # winner)) 24 | # replay_link = 'https://2021.battlecode.org/visualizer.html?tournamentMode&https://2021.battlecode.org/replays/' + game[4] + '.bc21' 25 | replay_link = game[4] 26 | print(replay_link) 27 | # blank line to separate games 28 | # print() 29 | # more blank lines to separate matches 30 | # print() 31 | print() 32 | 33 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/prep_tournament.sql: -------------------------------------------------------------------------------- 1 | -- MAKE A BACKUP ON GCLOUD BEFORE RUNNING THIS 2 | -- Also run this in steps not as a file 3 | 4 | -- 1: Set submissions_enabled to False in api_league 5 | update api_league set submissions_enabled=FALSE; 6 | 7 | -- 2: Change `tour_seed_id` to the current tournament 8 | update api_teamsubmission set tour_seed_id = last_1_id; 9 | 10 | -- 3: Add the tournament to the tournaments table 11 | insert into api_tournament (id, "name", style, date_time, divisions, stream_link, hidden, league_id) 12 | values (2, 'Seeding', 'doubleelim', CURRENTDATE, '{college}', STREAMLINK, True, 0); 13 | 14 | 15 | 16 | -- Get the emails of winning teams 17 | SELECT email from api_user left join api_team_users on api_team_users.user_id = api_user.id 18 | left join api_team on api_team_users.team_id = api_team.id 19 | WHERE api_team."name" in ('wining', 'team', 'names'); 20 | 21 | -- Lock in submissions for more advanced tournaments 22 | UPDATE api_teamsubmission SET tour_intl_qual_id=last_1_id FROM api_team WHERE api_team.id=api_teamsubmission.team_id AND api_team.international AND api_team.student; -------------------------------------------------------------------------------- /infrastructure/tournament-util/pull_seeding.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Usage: pull_seeding.py CSV_FILE 3 | 4 | import sys, os, requests 5 | 6 | KEY = os.getenv('BC20_CHALLONGE_KEY') 7 | 8 | response = requests.get(url='https://api.challonge.com/v1/tournaments/bc20_seeding/participants.json?api_key={}'.format(KEY)) 9 | response.raise_for_status() 10 | 11 | seeded = {} 12 | for team in response.json(): 13 | seeded[team['participant']['name']] = team['participant']['final_rank'] 14 | 15 | scrim_ranks = [] 16 | with open(sys.argv[1], 'r') as f: 17 | f.readline() # Skip the title row 18 | for line in f.readlines(): 19 | team_id, team_name, team_score = line.split(',') 20 | team_name = team_name[1:-1] # Remove quotation marks 21 | scrim_ranks.append((team_id, team_name, team_score)) 22 | 23 | teams = [] 24 | for rank, team_data in enumerate(scrim_ranks): 25 | team_id, team_name, team_score = team_data 26 | if team_name in seeded: 27 | teams.append((seeded[team_name], rank+1, team_id, team_name)) 28 | else: 29 | teams.append((1000000, rank+1, team_id, team_name)) 30 | teams.sort() 31 | 32 | with open('team_pk', 'w') as g: 33 | with open('team_names', 'w') as h: 34 | for team in teams: 35 | team_seed, team_scrim, team_id, team_name = team 36 | print (team) 37 | g.write(team_id+'\n') 38 | h.write(team_name+'\n') 39 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/scrim_ranks.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Gets the list of teams with at least one submission, in order of scrimmage rank. 3 | Useful for seeding tournaments such as Sprint. 4 | */ 5 | 6 | SELECT 7 | api_team.id, api_team.name, api_team.score 8 | FROM 9 | api_team 10 | INNER JOIN 11 | api_teamsubmission 12 | ON 13 | api_team.id = api_teamsubmission.team_id 14 | WHERE 15 | api_teamsubmission.last_1_id IS NOT NULL 16 | AND NOT api_team.staff_team 17 | AND NOT api_team.deleted 18 | ORDER BY 19 | score DESC; 20 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/scrim_ranks_verified.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Gets the list of teams consisting of only verified students, 3 | with at least one submission, in order of scrimmage rank. 4 | Useful for seeding tournaments which require only verified students. 5 | */ 6 | 7 | SELECT 8 | api_team.id, api_team.name, api_team.score 9 | FROM 10 | api_team 11 | INNER JOIN 12 | api_teamsubmission 13 | ON 14 | api_team.id = api_teamsubmission.team_id 15 | INNER JOIN 16 | api_team_users 17 | ON 18 | api_team.id = api_team_users.team_id 19 | INNER JOIN 20 | api_user 21 | ON 22 | api_team_users.user_id = api_user.id 23 | WHERE 24 | api_teamsubmission.last_1_id IS NOT NULL 25 | AND NOT api_team.staff_team 26 | AND NOT api_team.deleted 27 | GROUP BY 28 | api_team.id 29 | HAVING 30 | COUNT(api_user.id) = COUNT(CASE WHEN api_user.verified THEN 1 END) 31 | ORDER BY 32 | api_team.score DESC; 33 | -------------------------------------------------------------------------------- /infrastructure/tournament-util/util.py: -------------------------------------------------------------------------------- 1 | ../matcher/util.py -------------------------------------------------------------------------------- /infrastructure/tournament.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bc21-env 2 | 3 | # Install software dependencies 4 | RUN pip3 install --upgrade \ 5 | requests 6 | 7 | COPY config.py util.py bracketlib.py team_pk team_names maps.json tournament_server.py app/ 8 | 9 | WORKDIR app 10 | CMD python3 tournament_server.py 0 team_pk team_names maps.json 11 | -------------------------------------------------------------------------------- /infrastructure/worker.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bc21-env 2 | 3 | # Private key for gcloud authentication 4 | ENV GOOGLE_APPLICATION_CREDENTIALS /app/gcloud-key.json 5 | 6 | # # Install software dependencies 7 | RUN apt-get update \ 8 | && apt-get install -y apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common \ 9 | && wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - \ 10 | && add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ \ 11 | && apt-get update \ 12 | # install without prompt 13 | && apt-get install -y \ 14 | adoptopenjdk-8-hotspot \ 15 | # Need g++ for pip to successfully install google cloud dependencies 16 | g++ \ 17 | zip 18 | 19 | RUN pip3 install --upgrade \ 20 | requests \ 21 | google-cloud-pubsub \ 22 | google-cloud-storage 23 | 24 | # # Initialise box and game dependencies 25 | COPY box box/ 26 | RUN cd box && ./gradlew --no-daemon build && rm -rf build src 27 | 28 | COPY app/config.py app/subscription.py app/util.py app/gcloud-key.json app/ 29 | -------------------------------------------------------------------------------- /infrastructure/worker/box/gradle.properties: -------------------------------------------------------------------------------- 1 | # modify this file to change project properties 2 | teamA=examplefuncsplayer 3 | teamB=examplefuncsplayer 4 | packageNameA=examplefuncsplayer 5 | packageNameB=examplefuncsplayer 6 | maps=maptestsmall 7 | source=src 8 | version=2021.0.0.1 9 | gpr.user=battlecodedownloadpackage 10 | -------------------------------------------------------------------------------- /infrastructure/worker/box/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/infrastructure/worker/box/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /infrastructure/worker/box/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Dec 07 21:59:50 EST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /infrastructure/worker/box/settings.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/infrastructure/worker/box/settings.gradle -------------------------------------------------------------------------------- /infrastructure/worker/box/version.txt: -------------------------------------------------------------------------------- 1 | 2021.0.0.1 -------------------------------------------------------------------------------- /schema/.gitignore: -------------------------------------------------------------------------------- 1 | typings 2 | .idea 3 | *.iml -------------------------------------------------------------------------------- /schema/java/battlecode/schema/BodyType.java: -------------------------------------------------------------------------------- 1 | // automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | package battlecode.schema; 4 | 5 | /** 6 | * The possible types of things that can exist. 7 | * Note that bullets are not treated as bodies. 8 | */ 9 | public final class BodyType { 10 | private BodyType() { } 11 | /** 12 | * Enlightenment centers produce politicians, Muckrakers and slanderers and place bids 13 | *can be neutral until captured 14 | */ 15 | public static final byte ENLIGHTENMENT_CENTER = 0; 16 | /** 17 | * politicians use their influence to self destruct and capture other units 18 | */ 19 | public static final byte POLITICIAN = 1; 20 | /** 21 | * slanderers generate passive influence for the enlightenment center that created them 22 | * they turn into politicians at some point, and can only be identified by slanderers. 23 | */ 24 | public static final byte SLANDERER = 2; 25 | /** 26 | * have the ability to identify slanderers 27 | */ 28 | public static final byte MUCKRAKER = 3; 29 | 30 | public static final String[] names = { "ENLIGHTENMENT_CENTER", "POLITICIAN", "SLANDERER", "MUCKRAKER", }; 31 | 32 | public static String name(int e) { return names[e]; } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /schema/java/battlecode/schema/Vec.java: -------------------------------------------------------------------------------- 1 | // automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | package battlecode.schema; 4 | 5 | import java.nio.*; 6 | import java.lang.*; 7 | import java.util.*; 8 | import com.google.flatbuffers.*; 9 | 10 | @SuppressWarnings("unused") 11 | /** 12 | * A vector in two-dimensional space. Discrete space, of course. 13 | * Defaults to the 0 vector. 14 | */ 15 | public final class Vec extends Struct { 16 | public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; } 17 | public Vec __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 18 | 19 | public int x() { return bb.getInt(bb_pos + 0); } 20 | public int y() { return bb.getInt(bb_pos + 4); } 21 | 22 | public static int createVec(FlatBufferBuilder builder, int x, int y) { 23 | builder.prep(4, 8); 24 | builder.putInt(y); 25 | builder.putInt(x); 26 | return builder.offset(); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /schema/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battlecode-schema", 3 | "version": "2021.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/flatbuffers": { 8 | "version": "1.10.0", 9 | "resolved": "https://registry.npmjs.org/@types/flatbuffers/-/flatbuffers-1.10.0.tgz", 10 | "integrity": "sha512-7btbphLrKvo5yl/5CC2OCxUSMx1wV1wvGT1qDXkSt7yi00/YW7E8k6qzXqJHsp+WU0eoG7r6MTQQXI9lIvd0qA==", 11 | "dev": true 12 | }, 13 | "flatbuffers": { 14 | "version": "1.12.0", 15 | "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz", 16 | "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /schema/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battlecode-schema", 3 | "version": "2021.0.0", 4 | "private": "true", 5 | "description": "flatbuffers parser for battlecode match files", 6 | "main": "ts/index.ts", 7 | "scripts": { 8 | "test": "true", 9 | "build": "flatc --ts -o ts battlecode.fbs && flatc --java -o java battlecode.fbs" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/battlecode/battlecode-schema.git" 14 | }, 15 | "keywords": [ 16 | "battlecode" 17 | ], 18 | "author": "Teh Devs", 19 | "license": "GPL-3.0", 20 | "bugs": { 21 | "url": "https://github.com/battlecode/battlecode-schema/issues" 22 | }, 23 | "homepage": "https://github.com/battlecode/battlecode-schema#readme", 24 | "dependencies": { 25 | "flatbuffers": "^1.11.0", 26 | "@types/flatbuffers": "^1.9.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /schema/ts/index.ts: -------------------------------------------------------------------------------- 1 | import { battlecode as bc } from "./battlecode_generated"; 2 | import schema = bc.schema; 3 | export { schema }; 4 | 5 | export { flatbuffers } from 'flatbuffers'; 6 | 7 | // export { battlecode.schema as schema } from './battlecode_generated'; 8 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'battlecode-release' 2 | 3 | include 'engine', 'example-bots' 4 | include ":internal-test-bots" 5 | project(":internal-test-bots").projectDir = file("battlecode20-internal-test-bots") 6 | -------------------------------------------------------------------------------- /specs/README.md: -------------------------------------------------------------------------------- 1 | # Specs 2 | 3 | Game specs are in `specs.md`, which is the source of truth. 4 | 5 | We're using `Markdeep` to generate a pretty HTML version of the specs. Write the specs in Markdown, and ensure that the Markdeep header/footer tags are present. See samples on the Markdeep website for detailed usage. 6 | 7 | The following files are legacy from when we used Pandoc, and are not used in the current build. 8 | 9 | - `css/*` except for `css/journal.css` 10 | - `fonts/` 11 | - `js/*` except for `js/markdeep.min.js` 12 | - `template.html` 13 | -------------------------------------------------------------------------------- /specs/css/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-webkit-viewport { width: device-width; } 12 | @-moz-viewport { width: device-width; } 13 | @-ms-viewport { width: device-width; } 14 | @-o-viewport { width: device-width; } 15 | @viewport { width: device-width; } 16 | -------------------------------------------------------------------------------- /specs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/specs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /specs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/specs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /specs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/specs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /specs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/battlecode/battlecode21/ed39c1a49574db57e5463d720736220506280294/specs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /specs/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | --------------------------------------------------------------------------------