示例#1
0
文件: state.go 项目: 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,
	)
}
示例#2
0
文件: state.go 项目: 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
}