I suppose that would make sense, as a Point should not know all about the intricacies of Board layout. For example, I can think of several games (Risk comes to mind) where two Points would be next to one another, but there is no algorithmic way of determining that. So, I suppose the Board should determine next-to-ness.package Point; # Stuff here... sub isNextTo { my $self = shift; my $newPoint = shift; return $self->{PARENT}->Point_isNextTo($self, $newPoint); } # Stuff here...
*frowns* Does that mean that the Board should be able to dip into the Point's inner workings and get its X and Y coordinates? How would this work without using an accessor function?
------
We are the carpenters and bricklayers of the Information Age.
Vote paco for President!
In reply to Re: (dws)Re: OO vs. global variables...
by dragonchild
in thread OO vs. global variables...
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |