MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / get_replayer

Function get_replayer

codeclash/replay/__init__.py:39–84  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

37
38
39def 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()

Callers 2

replayFunction · 0.90
load_tournamentFunction · 0.85

Calls 10

BattleSnakeReplayerClass · 0.90
RobotRumbleReplayerClass · 0.90
ChessReplayerClass · 0.90
GomokuReplayerClass · 0.90
HaliteReplayerClass · 0.90
Halite2ReplayerClass · 0.90
Halite3ReplayerClass · 0.90
BomberlandReplayerClass · 0.90
BridgeReplayerClass · 0.90
FiggieReplayerClass · 0.90

Tested by

no test coverage detected