-
Notifications
You must be signed in to change notification settings - Fork 1
/
Commande.h
41 lines (30 loc) · 818 Bytes
/
Commande.h
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
using namespace std;
#ifndef __Commande_h__
#define __Commande_h__
#include <iostream>
#include <exception>
#include <string>
#include <map>
#include "Robot.h"
#include "Parser.h"
using namespace std;
class Parser;
class Commande
{
public: static map<string, Commande*> &commandesInscrites();
static map<string, vector<Commande*> > macroCommandes;
public:
Parser* _invocateur;
protected:
Commande(){};
Commande(string nom, Parser* i){};
public: static Commande* nouvelleCommande(string c, Parser* p) {
return commandesInscrites()[c]->virtualConstructor(p);
}
public:
virtual void executer(Robot* r) = 0;
virtual void annuler(Robot* r) = 0;
virtual bool estAnnulable() = 0;
virtual Commande* virtualConstructor(Parser* p) = 0;
};
#endif