Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Re: OO vs. global variables...by Boots111 (Hermit) |
on Sep 06, 2001 at 03:08 UTC ( [id://110442]=note: print w/replies, xml ) | Need Help?? |
I know that this is not a C++ forum; however, it is a programming one and learning one language helps with all others... This is a completely incorrect use of templates. Templates take only a class (not an instance of a class), thus you would get <int, int> rather than <8,8>. What you want here is a constructor that takes two int's (or scalars) as arguments, and builds the class based on this input. The solution that has point as a base class and three inherited classes, middle-point, edge-point, and corner-point, is what fits best into an OO design pattern. Because the whole purpose of OOP is to have each class only worry about itself. However, you might consider making a line class to determine captures since captures are really line oriented... Matt
In Section
Seekers of Perl Wisdom
|
|