Return the renderer for an arena, or ``None`` if none exists yet. Imports are lazy so pulling in one arena's replay code never drags in the others.
(arena: str)
| 37 | |
| 38 | |
| 39 | def get_replayer(arena: str) -> ReplayRenderer | None: |
| 40 | """Return the renderer for an arena, or ``None`` if none exists yet. |
| 41 | |
| 42 | Imports are lazy so pulling in one arena's replay code never drags in the others. |
| 43 | """ |
| 44 | if arena == "BattleSnake": |
| 45 | from codeclash.arenas.battlesnake.replay import BattleSnakeReplayer |
| 46 | |
| 47 | return BattleSnakeReplayer() |
| 48 | if arena == "RobotRumble": |
| 49 | from codeclash.arenas.robotrumble.replay import RobotRumbleReplayer |
| 50 | |
| 51 | return RobotRumbleReplayer() |
| 52 | if arena == "RoboCode": |
| 53 | from codeclash.arenas.robocode.replay import RoboCodeReplayer |
| 54 | |
| 55 | return RoboCodeReplayer() |
| 56 | if arena == "CoreWar": |
| 57 | from codeclash.arenas.corewar.replay import CoreWarReplayer |
| 58 | |
| 59 | return CoreWarReplayer() |
| 60 | if arena == "Chess": |
| 61 | from codeclash.arenas.chess.replay import ChessReplayer |
| 62 | |
| 63 | return ChessReplayer() |
| 64 | if arena == "Gomoku": |
| 65 | from codeclash.arenas.gomoku.replay import GomokuReplayer |
| 66 | |
| 67 | return GomokuReplayer() |
| 68 | if arena == "PaintVolley": |
| 69 | from codeclash.arenas.paintvolley.replay import PaintVolleyReplayer |
| 70 | |
| 71 | return PaintVolleyReplayer() |
| 72 | if arena == "LightCycles": |
| 73 | from codeclash.arenas.lightcycles.replay import LightCyclesReplayer |
| 74 | |
| 75 | return LightCyclesReplayer() |
| 76 | if arena == "Ants": |
| 77 | from codeclash.arenas.ants.replay import AntsReplayer |
| 78 | |
| 79 | return AntsReplayer() |
| 80 | if arena == "Halite": |
| 81 | from codeclash.arenas.halite.replay import HaliteReplayer |
| 82 | |
| 83 | return HaliteReplayer() |
| 84 | if arena == "Halite2": |
| 85 | from codeclash.arenas.halite2.replay import Halite2Replayer |
| 86 | |
| 87 | return Halite2Replayer() |
no test coverage detected