00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef CORNER_H
00017 #define CORNER_H
00018 #include "rotenums.h"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
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