From 3d36d1d0254b8aeecc889a2a49cbcced458cbe9c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 25 Feb 2023 23:08:47 +0100 Subject: intermediate commit * Implement move artifact action * Fix widget update memory leak * update the highlights not during on each frame * do not update the unchanged label of a button * Allow to exit the game by pressing 'q' * Implement some cards from the magic set * Improve permanent formatting * Some tweaks to UnitAI code --- go/game/pos.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'go/game/pos.go') diff --git a/go/game/pos.go b/go/game/pos.go index 2a646a83..133f599b 100644 --- a/go/game/pos.go +++ b/go/game/pos.go @@ -9,12 +9,14 @@ type Position struct { Y int } -func (p *Position) String() string { - if *p == INVALID_POSITION() { +const POSITION_FMT = "(%d, %d)" + +func (p Position) String() string { + if p == INVALID_POSITION() { return "INVALID_POSITION" } - return fmt.Sprintf("(%d, %d)", p.X, p.Y) + return fmt.Sprintf(POSITION_FMT, p.X, p.Y) } func INVALID_POSITION() Position { -- cgit v1.2.3