(fromID, toID string)
| 493 | } |
| 494 | |
| 495 | func (b *Board) Connect(fromID, toID string) *StringConn { |
| 496 | if fromID == toID || fromID == "" || toID == "" { |
| 497 | return nil |
| 498 | } |
| 499 | for _, s := range b.Strings { |
| 500 | if (s.A.NoteID == fromID && s.B.NoteID == toID) || |
| 501 | (s.A.NoteID == toID && s.B.NoteID == fromID) { |
| 502 | return s |
| 503 | } |
| 504 | } |
| 505 | s := &StringConn{ |
| 506 | A: StringEnd{NoteID: fromID}, |
| 507 | B: StringEnd{NoteID: toID}, |
| 508 | Tight: false, |
| 509 | } |
| 510 | b.Strings = append(b.Strings, s) |
| 511 | return s |
| 512 | } |
| 513 | |
| 514 | // ConnectToWall creates a string from a note to a WORLD-coord wall-pin. |
| 515 | // The caller is responsible for converting a mouse click (screen) to |
no outgoing calls
no test coverage detected