Direction Vectors
We've been using two kinds of systems to describe cell locations and laser beam direction. In one situation we use x@y (column x, row y) objects to describe where cells are located within the grid. We describe laser beam direction with the symbols #north, #east, #south and #west. A system needs to be constructed to allow us to combine these concepts when we start to navigate our laser beam across the grid and through cells. A clean class hierarchy of direction classes can handle the details nicely for us. Add the following classes, shown here in the correct hierarchy. Note that they are added on the Laser-Game-Model system category.
Each of the specific subclasses (North, East,...) will have 2 class methods.
GridDirectionNorth
GridDirectionEast
GridDirectionSouth
GridDirectionWest
When we want the proper GridDirection class we can send a message to the super class. Add this class method to the GridDirection class.