Пример #1
0
func (s *Sheeple) Deserialize(r io.Reader) error {
	dec := json.NewDecoder(r)
	us := UserSheeple{}
	err := dec.Decode(&us)
	if err != nil {
		return err
	}
	s.Rudder = UserRudder2Rudder(us.UserRudder)
	s.LastP = lib.UserVec2BlasVec(us.LastP)
	return nil
}
Пример #2
0
func UserRudder2Rudder(ur UserRudder) Rudder {
	r := Rudder{}
	r.D = lib.UserVec2BlasVec(ur.D)
	r.S = ur.S
	return r
}