From 48837a7456a334f096a1014a47540ad4c5a4b8d5 Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Sat, 18 Jul 2026 17:01:47 +0000 Subject: [PATCH] a2a-source-edit: write agent.py --- agent.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/agent.py b/agent.py index fa749e2..8555342 100644 --- a/agent.py +++ b/agent.py @@ -330,8 +330,8 @@ def _slugify(value: str) -> str: return slug or "game-asset" -def _scale(unit: float, n: float) -> str: - return f"{n * unit:.2f}" +def _scale(unit: float, amount: float) -> str: + return f"{amount * unit:.2f}" def _render_svg( @@ -382,7 +382,10 @@ def _render_svg( def _asset_body(asset_type: str, style: str, primary: str, accent: str, dark: str, stroke: int, unit: float, pattern: int) -> str: fill = "none" if style == "outline" else primary common = f'stroke="{dark}" stroke-width="{stroke}" stroke-linejoin="round" stroke-linecap="round"' - p = lambda n: _scale(unit, n) + + def p(amount: float) -> str: + return _scale(unit, amount) + if asset_type == "character": return ( f'' @@ -393,9 +396,10 @@ def _asset_body(asset_type: str, style: str, primary: str, accent: str, dark: st spike_points: list[str] = [] for i in range(7): spike_points.append(f'{p(2 + i * 2)},{p(7 + ((pattern + i) % 3))}') + spike_points_text = " ".join(spike_points) return ( f'' - f'' + f'' f'' ) if asset_type == "item":