diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-22 18:36:07 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:28 +0200 |
| commit | 4a3cc2211062deeae5aa1c6cefaed772ba44efc3 (patch) | |
| tree | 740b216ada9d27a9f5d8c2bcf6c756c18ffea0c5 /go | |
| parent | c6c0d42964c73c6b8eac656c401939a7fef5bbe8 (diff) | |
| download | muhqs-game-4a3cc2211062deeae5aa1c6cefaed772ba44efc3.tar.gz muhqs-game-4a3cc2211062deeae5aa1c6cefaed772ba44efc3.zip | |
minor cleanup removing debug prints
Diffstat (limited to 'go')
| -rw-r--r-- | go/game/action.go | 6 | ||||
| -rw-r--r-- | go/game/cardParsing.go | 2 | ||||
| -rw-r--r-- | 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) } } |
