The Millenium Falcon has a crew of Han Solo, Chewbacca and Luke Sky Walker. Write the classes (included the Visitor class referenced below) you need to make the crew say (trace) their catchphrases (e.g. Chewy says "Gwaaraghhghll").
Class MilleniumFalcon
{
protected var han:Pilot
protected var chewbacca:Wookie;
protected var luke:Gunner;
function accept(visitor:IMilleniumFalconVisitor) : Void
{
visitor.visit(this)
}
function getCrew() : Array
{
return [han, chewbacca, luke]
}
}
Ok without further ado...
Tried to remove the need for hardcoded crew members - would suck if one died and the whole ship would have to be recompiled before a replacement could be found - I dislike my approach though - I think I should have used decorators? Now because Wookie implements crew - any Wookie can join the crew, but they might not be properly trained. Instead maybe I could have made a decorator that could add skills to the wookie / other class upon completion of training?