class TestCase::PointForTest {
interface Stringable;
interface Cloneable;
has x : rw int;
has y : rw int;
static method new : TestCase::PointForTest () {
return new TestCase::PointForTest;
}
static method new_xy : TestCase::PointForTest ($x : int, $y : int) {
my $point = TestCase::PointForTest->new;
$point->set_x($x);
$point->set_y($y);
return $point;
}
method to_string : string () {
my $x = $self->x;
my $y = $self->y;
my $string = "($x,$y)";
return $string;
}
method clone : TestCase::PointForTest () {
my $point_clone = TestCase::PointForTest->new_xy($self->x, $self->y);
return $point_clone;
}
method : string ($num : int) {
return $num;
}
}