Esempio n. 1
0
File: state.go Progetto: samuell/exp
// 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,
	)
}
Esempio n. 2
0
File: state.go Progetto: samuell/exp
// 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
}