Exemple #1
0
// Cube utilities
func (cube *Cube) ReadFrom(r io.Reader) error {
	return bit.Read(r,
		&cube.Largest,
		&cube.A, &cube.B, &cube.C,
		&cube.X, &cube.Y, &cube.Z,
		&cube.Interacting,
	)
}
Exemple #2
0
// Cube utilities
func (cube *Cube) ReadFrom(r io.Reader) error {
	interacting := int32(0)
	err := bit.Read(r,
		&cube.Rot.X, &cube.Rot.Y, &cube.Rot.Z, &cube.Rot.W,
		&cube.Pos.X, &cube.Pos.Y, &cube.Pos.Z,
		&interacting,
	)
	cube.Interacting = interacting == 1
	return err
}