MCPcopy
hub / github.com/cli/cli / move

Method move

pkg/cmd/repo/garden/garden.go:62–87  ·  view source on GitHub ↗
(direction Direction)

Source from the content-addressed store, hash-verified

60type Direction = int
61
62func (p *Player) move(direction Direction) bool {
63 switch direction {
64 case DirUp:
65 if p.Y == 0 {
66 return false
67 }
68 p.Y--
69 case DirDown:
70 if p.Y == p.Geo.Height-1 {
71 return false
72 }
73 p.Y++
74 case DirLeft:
75 if p.X == 0 {
76 return false
77 }
78 p.X--
79 case DirRight:
80 if p.X == p.Geo.Width-1 {
81 return false
82 }
83 p.X++
84 }
85
86 return true
87}
88
89type GardenOptions struct {
90 HttpClient func() (*http.Client, error)

Callers 1

gardenRunFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected