#include <string>
#include <vector>
#include <cstdio>

class Color
{
public:
  float r, g, b, alpha;
  Color() {  }       
  Color(float r, float g, float b, float alpha);
  //Color(const Color& orig);

  void drawColor();
  void setColor(const Color& color);
  void exchangeColor(Color & color);
};

Color::Color(float red, float green, float blue, float alpha)
{
  Color::r = red;
  Color::g = green;
  Color::b = blue;
  Color::alpha = alpha;
} 	

const Color yellow = Color ( 1.0f, 1.0f, 0.0f, 1.0f );
const Color orange = Color ( 1.0f, 0.5f, 0.0f, 1.0f );
const Color green  = Color ( 0.0f, 1.0f, 0.0f, 1.0f );
const Color red    = Color ( 1.0f, 0.0f, 0.0f, 1.0f );
const Color blue   = Color ( 0.4f, 0.4f, 1.0f, 1.0f );
const Color black  = Color ( 0.0f, 0.0f, 0.0f, 1.0f );

enum Side
  {
    Front = 1, Left = 2, Back = 3, Right = 4, Top = 5, Bottom = 6
  };

enum Edge
  {
    ELeft, ETop, ERight, EBottom, Non
  };


class Stone{
public:
  Color color1, color2, color3;
  Side side;
  Edge edge1, edge2;
  bool StoneUsed;

  Stone(){};       
  Stone(Side side, Edge edge1, Edge edge2);

}; 

class Cube{
public:
  std::vector<std::vector<std::vector<Stone> > > cube;
  int cubesize;
  Cube() {  }
  Cube(int cubesize);
  static std::string identifyColor(Color& color);
private:
  bool isCorner(int x, int y, int z);
  void setStone(int x, int y, int z);       
}; 	

using namespace std;

Cube :: Cube(int sizeOfCube)
{
  cubesize = sizeOfCube;

  for(int x = 0; x < cubesize; x++)
    {
      vector<vector<Stone> > side (cubesize);
      cube.push_back(side);
      for(int y = 0; y < cubesize; y++)
        {
          vector<Stone> line (cubesize);
          cube.at(x).push_back(line);
          for(int z = 0; z < cubesize; z++)
            {  
              cube.at(x).at(y).push_back(Stone());
            }               
        }
    }

  // Stein vorne oben links mit Farben grün-rot-gelb

  string col;
  Color color = Color(green);
  //  col = identifyColor(color);

  printf("%s \n",col.c_str());
  printf("%f, %f, %f \n",green.r, green.g, green.b);
  printf("-------------------------------\n");

  cube.at(0).at(0).at(0) = Stone(Front, ELeft, ETop);

  col;
  color = Color(green);
  //  col = identifyColor(color);

  printf("%s \n",col.c_str());
  printf("%f, %f, %f \n",green.r, green.g, green.b);
  printf("-------------------------------\n"); 
}



Stone :: Stone(Side side, Edge edge1, Edge edge2){
  
  printf("%f, %f, %f \n",green.r, green.g, green.b);
  printf("-------------------------------\n");
  
  //  getSideColor(side,edge1,edge2);
  
  printf("%f, %f, %f \n",green.r, green.g, green.b);
  printf("-------------------------------\n");
} 

int main()
{
  std::vector<std::vector<std::vector<Stone> > > cube;
  string col;
  Color color = Color(green);
  // col = identifyColor(color);
  
  printf("%s \n",col.c_str());
  printf("%f, %f, %f \n",green.r, green.g, green.b);
  printf("-------------------------------\n");
  
  // Hier wird ganz offensichtlich der Konstruktor von Stone aufgerufen.
  Stone(Front, ELeft, ETop);
  
  col;
  color = Color(green);
  //col = identifyColor(color);
  
  printf("%s \n",col.c_str());
  printf("%f, %f, %f \n",green.r, green.g, green.b);
  printf("-------------------------------\n"); 
}
