summaryrefslogtreecommitdiff
path: root/sem_3/Programm/jeu_de_la_vie/option.h
blob: e420c4ae3b3bcca3dd70059e8628a26ee6635abb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __OPTION_H
#define __OPTION_H

#include <string>

class Option {
 public:
  enum Type {
    AUCUN,
    BOOLEEN,
    ENTIER,
    REEL,
    CHAR,
    CHAINE
  };
  
 private:
  int id;
  std::string nom, raccourci, description;
  Type type;
  
 public:
  Option();
  Option(int id, const std::string &nom, const std::string &raccourci,
	 const std::string &desc, Type type);

  // Accesseurs en lecture
  int getId() const;
  std::string getName() const;
  std::string getShortcut() const;
  std::string getDescription() const;
  Type getType() const;

  // Accesseurs en écriture
  void setId(int id);
  void setName(const std::string &name);
  void setShortcut(const std::string &shortcut);
  void setDescription(const std::string &desc);
  void setType(Type t);

  // Affichage
  void print() const;
};

std::string Type2String(Option::Type t);

#endif