I cannot wrap my head as to how to access my enum class Azimuth.
Code:
#ifndef BOUSOLE_H
#define BOUSOLE_H
#include <iostream>
#include <string>
#include "StringHandler.h"
class Bousole{
public:
enum class Azimuth {NORD = 0, //HOW TO ACCESS THESE
EST = 90,
SUD = 180,
OUEST = 270,
UNSET=-1};
Bousole();
Bousole(int deg);
Bousole(Azimuth az);
void setNord();
void setEst();
void setSud();
void setOuest();
void setAzimuth(int deg);
void setAzimuth(Azimuth az);
void display();
Azimuth getAzimuth();
std::string getPointcardinal();
std::string toString();
std::string toString(Azimuth az);
private:
int m_degre;
Azimuth azimuth;
};
#endif
And here is where I am trying to access my enum for testing/understanding purposes
Code:
#include "Bousole.h"
using namespace std;
int main (int argc, char *argv[]){
cout <<"Start bousole" << endl;
Bousole b;
Bousole::Azimuth az; //Dont think this the way to go...
b.display();
cout << "Understand Azimuth ";
cout <<az::NORD << endl; //CONFUSED HERE
cout << "Setting Est...";
b.setEst();
b.display();
return 0;
}