Esempio n. 1
0
func FromGameBoard(gb *game.Board) *Board {
	var newb Board
	var gsq *game.Square
	for oac := range game.AMFT {
		gsq = gb.GPos(oac)
		newb[oac[0]][oac[1]] = Square{gsq.NotEmpty, Piece{gsq.FigType, gsq.Color()}}
	}
	return &newb
}
Esempio n. 2
0
func (b *Board) Equal(gb *game.Board) bool {
	var gs *game.Square
	var os *Square
	for oac := range game.AMFT {
		gs = gb.GPos(oac)
		os = b.GPos(Pos(oac))
		if !os.Equal(gs) {
			return false
		}
	}
	return true
}