void TetrixPiece::rotateRight() { if ( pieceType == 5 ) // don't rotate square piece type return; int tmp; for (int i = 0 ; i < 4 ; i++) { tmp = getXCoord(i); setXCoord(i,-getYCoord(i)); setYCoord(i,tmp); } }
Point::Point(double x, double y) { setXCoord(x); setYCoord(y); }
Point::Point() { setXCoord(0.0); setYCoord(0.0); }
Point::Point(double x1, double y1) //overloaded constructor passing 2 double parameters to set functions, initialize Point fields { setXCoord(x1); setYCoord(y1); }
//Implementation of Point class (function definitions) Point::Point() //default constructor uses set functions to initialize xCoord, yCoord to 0.0 { setXCoord(0.0); setYCoord(0.0); }