File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 11package chess
22
3+ import "strings"
4+
35// A MoveTag represents a notable consequence of a move.
46type MoveTag uint16
57
@@ -63,3 +65,46 @@ func (m *Move) HasTag(tag MoveTag) bool {
6365func (m * Move ) addTag (tag MoveTag ) {
6466 m .tags |= tag
6567}
68+
69+ func (m * Move ) GetCommand (key string ) string {
70+ return m .command [key ]
71+ }
72+
73+ func (m * Move ) SetCommand (key , value string ) {
74+ m .command [key ] = value
75+ }
76+
77+ func (m * Move ) AddComment (comment string ) {
78+ comments := strings.Builder {}
79+ comments .WriteString (m .comments )
80+ comments .WriteString (comment )
81+ m .comments = comments .String ()
82+ }
83+
84+ func (m * Move ) Comments () string {
85+ return m .comments
86+ }
87+
88+ func (m * Move ) NAG () string {
89+ return m .nag
90+ }
91+
92+ func (m * Move ) SetNAG (nag string ) {
93+ m .nag = nag
94+ }
95+
96+ func (m * Move ) Parent () * Move {
97+ return m .parent
98+ }
99+
100+ func (m * Move ) Position () * Position {
101+ return m .position
102+ }
103+
104+ func (m * Move ) Children () []* Move {
105+ return m .children
106+ }
107+
108+ func (m * Move ) Number () uint {
109+ return m .number
110+ }
You can’t perform that action at this time.
0 commit comments