From 6fe364a2d759d5da1327eb30fc4cc8e682d46908 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 22 Jul 2025 18:36:07 -0400 Subject: minor cleanup removing debug prints --- go/game/action.go | 6 +++--- go/game/cardParsing.go | 2 -- go/game/map.go | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go/game/action.go b/go/game/action.go index 0533a109..5f478de7 100644 --- a/go/game/action.go +++ b/go/game/action.go @@ -743,11 +743,11 @@ var ActionRegex = regexp.MustCompile(`^([^\xA0]*)\xA0([^\xA0]*)\xA0?(.*)?$`) func UnmarshalAction(s State, in []byte) (a Action, err error) { m := ActionRegex.FindSubmatch(in) if len(m) < 2 || len(m) > 4 { - log.Println(m) return nil, InvalidActionFormat } _action := string(m[2]) - if _action == "pick" { + switch _action { + case "pick": p := s.PlayerByName(string(m[1])) if p == nil { err = errors.New("Unknown player") @@ -764,7 +764,7 @@ func UnmarshalAction(s State, in []byte) (a Action, err error) { return nil, err } a = NewDraftPick(p, pack, pick) - } else if _action == "pass" { + case "pass": p := s.PlayerByName(string(m[1])) if p == nil { err = errors.New("Unknown player") diff --git a/go/game/cardParsing.go b/go/game/cardParsing.go index f9069e43..5ccf181a 100644 --- a/go/game/cardParsing.go +++ b/go/game/cardParsing.go @@ -237,7 +237,6 @@ func parseLocation(location string) func(interface{}, *LocalState) []*Tile { func (impl *dynamicCardImplementation) parsePlayModification(effect string) { tokens := strings.SplitN(effect, " can be played ", 2) - log.Println(tokens) what, how := tokens[0], tokens[1] if what == strings.ToLower(impl.card.Name) { if locationFunc := parseLocation(how); locationFunc != nil { @@ -246,7 +245,6 @@ func (impl *dynamicCardImplementation) parsePlayModification(effect string) { log.Println("Play modification other than locations are not implemented ") } } else { - log.Println(effect) log.Println("Play modification for other cards are not implemented") } } diff --git a/go/game/map.go b/go/game/map.go index 54071933..d918d87d 100644 --- a/go/game/map.go +++ b/go/game/map.go @@ -32,6 +32,7 @@ type MapYml struct { } type Map struct { + // Tile slices of rows containing the individual tiles. Tiles [][]Tile symbols map[string]string ResourceGain int @@ -103,7 +104,6 @@ func ParseMap(data []byte) (*Map, error) { owner := s.PlayerById(i + 1) // TODO: Fix position index base. pos := Position{kingPos[0] - 1, kingPos[1] - 1} - log.Println(card, pos, owner) s.addNewUnit(card, pos, owner) } } -- cgit v1.2.3