(inputBus, outputBus *Bus)
| 502 | } |
| 503 | |
| 504 | func NewBusOne(inputBus, outputBus *Bus) *BusOne { |
| 505 | b := new(BusOne) |
| 506 | b.inputBus = inputBus |
| 507 | b.outputBus = outputBus |
| 508 | |
| 509 | for i, _ := range b.andGates { |
| 510 | b.andGates[i] = *circuit.NewANDGate() |
| 511 | } |
| 512 | |
| 513 | b.notGate = *circuit.NewNOTGate() |
| 514 | b.orGate = *circuit.NewORGate() |
| 515 | |
| 516 | return b |
| 517 | } |
| 518 | |
| 519 | func (b *BusOne) ConnectOutput(bc Component) { |
| 520 | b.next = bc |