/*
  overrideprint.c: test program for Vector2, overriding how one vector prints
*/


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>


#include "vector2.h"


// override print method for specific objects..
static void myprint( Vector2 this )
{
	printf( "hello from myprint" );
}


int main( void )
{
	Vector2 a      = new_Vector2( 10, 0 );
	Vector2 b      = new_Vector2( 0, 10 );
	b->print       = &myprint;

	printf( "create a and b, then override b->print\n" );
	printf( "a isa %s. b isa %s\n", a->isa, b->isa );
	printf( "a=" );
	OM0(a,print);
	printf( ", b=" );
	OM0(b,print);
	printf( "\n" );

	OM0(b,dispose);
	OM0(a,dispose);
	exit(0);
	return 0;
}
