I was going to add interfaces, but ran into problems, so I am just submitting this.
Problems:
Since our AIs will take different parameters it will create different functions signatures, so we cannot user interface for that. And we cannot specify shouldKeepGoing() with different signatures in the interface:
type Addy interface{
add(x, y int) int
add(x, y, z int) int // duplicate method add
}
Unless I am missing something, something like this is not allowed.
If the above does not work, the only other option I see is to pass all the possible parameters to every AI, and they will just use what they need. But I am not sure this would be better deign, probably not.
I was going to add interfaces, but ran into problems, so I am just submitting this.
Problems:
Since our AIs will take different parameters it will create different functions signatures, so we cannot user interface for that. And we cannot specify shouldKeepGoing() with different signatures in the interface:
Unless I am missing something, something like this is not allowed.
If the above does not work, the only other option I see is to pass all the possible parameters to every AI, and they will just use what they need. But I am not sure this would be better deign, probably not.