#pragma once

namespace jewels
{

struct Jewel
{
    enum
    {
        None = 0,
        Red,
        Purple,
        Cyan,
        Blue,
        Lime,
        Orange,
        Green,
        _Count
    };
    
    unsigned color;
    
    Jewel():
        color(None){}
    explicit Jewel(unsigned c):
        color(c){}
    
    Jewel& operator=(unsigned c) {
        color = c;
        return *this;
    }
    
    bool empty() const {
        return color == None;
    }
    
    static constexpr unsigned count() {
        return _Count - 1;
    }
};

inline bool operator==(const Jewel& a, const Jewel& b)
{
    return a.color == b.color;
}

}