/***************************************************************************
                           cubedecoration.h
                           -------------------
    copyright            : (C) 2004 by Jos van den Oever
    email                : jos@vandenoever.info
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CUBEDECORATION_H
#define CUBEDECORATION_H
#include "rotenums.h"

/* A cube decoration simply holds for the decoration of an original cube
   in a cubetest question. A cube has 6 sides. Each side has a decoration.
   When unfolded, a cube would look like this:

           2
          4015
           3

   The numbers relate to the positions in the arrays in this class. The siderot
   for the shown sides is 0. Setting the value of siderot for side 3 to e.g. 1
   would rotate the '3' 90 degrees clockwise.

   The array sym holds the symmetry of each side decoration. The array type
   holds the type of drawing: a unique number for each unique type of side.
   A side of type 1 and symmetry C1 has a different decoration than a side of
   symmetry C1 and type 2.
   The array siderot holds the orientation of a side as described above.

   The variable 'orientation' determines in which orientation the cube is shown.
   This value is important: in most questions, not all orientations allow one
   to distinguish between two cubes that are not equal. So the class
   QuestionGenerator has to carefully choose an orientation that allows the
   user to distinguish the cube from the given cube.
*/

struct CubeDecoration {
	// symmetry of the cube, see rotenums.h for type 'Symmetry'
	Symmetry sym[6];

	/* list of type for each side, each unique combination of a Symmetry 
	   value and a unique type value is a unique side decoration. */
	short type[6];

	/* for a side decoration with a symmetry != C4, the orientation of the
           decoration on the side is of importance. This value is stored in
           this array.
           This value is not important when generating a valid question.
           It is only important when drawing the question. */
	Rotation siderot[6];

	/* orientation (0-23) in which the cube is displayed. */
	short orientation;

	/* function to compare two cubes */
	bool operator==(const CubeDecoration &) const;
};

#endif
