Main Page | Class Hierarchy | Compound List | File List | Compound Members

corner.h

00001 /***************************************************************************
00002                            corner.h
00003                            -------------------
00004     copyright            : (C) 2004 by Jos van den Oever
00005     email                : jos@vandenoever.info
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef CORNER_H
00017 #define CORNER_H
00018 #include "rotenums.h"
00019 /*
00020          /\
00021         |\/|
00022          \/
00023          /^\
00024         |\ /|
00025          \|/
00026             5
00027            /^\
00028         1/  2  \4
00029         |\     /|
00030         |  \0/  |
00031         | 0 | 1 |
00032         2\  |  /7
00033            \|/
00034             3
00035 */
00036 
00037 /* global function that returns an integer random number from [0, max>. */
00038 extern short rand(short);
00039 class Corner {
00040 public:
00041         Symmetry sym[3];
00042         short type[3];
00043         short cor[3];
00044         void reduceCorner();
00045         short mapcor(short i, short j) const;
00046         bool operator==(const Corner &c) const;
00047         short count(short, Symmetry) const;
00048         bool isBlank() const;
00049         bool is2_3Blank() const;
00050 };
00051 class CubeDecoration;
00052 class Question;
00053 class Corners {
00054 private:
00055         Corner orig[8];
00056         void setCorners(Corner o[8], const CubeDecoration &c, bool) const;
00057         bool checkCorner(const Corner &, const Question &) const;
00058 public:
00059         Corners(const CubeDecoration &);
00060         short chooseOrientation(const CubeDecoration&c, const Question&,
00061                 Corner &visc) const;
00062         const Corner &operator[](short i) const { return orig[i];}
00063 };
00064 #endif

Generated on Thu Jan 15 23:13:57 2004 for CubeTest by doxygen 1.3.2