/*
 * Save routine. This operation saves the state of the object to a
 * data source.
 *
 * The object system will automatically invoke the save routines of
 * the parent beforehand.
 */
static int
Save(void *obj, AG_DataSource *ds)
{
	Mammal *mammal = obj;

	AG_WriteFloat(ds, mammal->hairColor.h);
	AG_WriteFloat(ds, mammal->hairColor.s);
	AG_WriteFloat(ds, mammal->hairColor.v);
	return (0);
}
Exemple #2
0
static void
Save(void *p, AG_DataSource *ds)
{
	VG_Circle *vc= p;

	VG_WriteRef(ds, vc->p);
	AG_WriteFloat(ds, vc->r);
}
Exemple #3
0
/*
 * Save routine. This operation saves the state of the object to a
 * data source.
 *
 * The object system will automatically invoke the save routines of
 * the parent beforehand.
 */
static int
Save(void *obj, AG_DataSource *ds)
{
	Animal *animal = obj;

	AG_WriteFloat(ds, animal->age);
	AG_WriteUint32(ds, (int)animal->cellCount);
	return (0);
}