Open main menu

CDOT Wiki β

Changes

Project A2 20141 - OOP344

1,096 bytes added, 01:39, 8 March 2014
Clarifications: hide
==== Border ====
If the constructor receives a border character string that is NULL or is too short (less than 8 characters), the constructor should default to C_BORDER_CHARS.
 
==== hide ====
Hide's purpose is to hide the current object and restore whatever were the contents on the screen that it overwrote.
 
Hide accepts a CDirection value that indicates which direction that the current object is moving. Passing in C_STATIONARY indicates that the frame is not moving and that all hidden contents should be restored while any of the other values will restore only one row/column. The behaviours are:
 
* C_STATIONARY: will restore all of the screen contents hidden by the current object.
* C_MOVED_LEFT: will restore the right-most column.
* C_MOVED_RIGHT: will restore the left-most column.
* C_MOVED_UP: will restore the bottom row.
* C_MOVED_DOWN: will restore the top row.
 
This is an optimization. To explain this optimization, let's assume that hide has received the value C_MOVED_RIGHT. In this case, we only need to restore the left-most column of the contents since that column will be the only part of the contents that our object was hiding that will be shown since the rest will continue to be hidden underneath our object once it moves right by one column.
=== Recommendations ===