1 /*
2  Copyright (C) 2010 - 2018 by Gabriel Morin <gabrielmorin (at) gmail (dot) com>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13  */
14 
15 /**
16  * @file
17  * visitor is an abstract interface :
18  *       action.accept(visitor)   calls    visitor.visit(action)
19  */
20 
21 #pragma once
22 
23 #include "typedefs.hpp"
24 
25 namespace wb
26 {
27 
28 /**
29  * Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses.
30  */
31 class visitor
32 {
33 public:
34 	virtual void visit(move_ptr move) = 0;
35 	virtual void visit(attack_ptr attack) = 0;
36 	virtual void visit(recruit_ptr recruit) = 0;
37 	virtual void visit(recall_ptr recall) = 0;
38 	virtual void visit(suppose_dead_ptr sup_d) = 0;
39 
40 protected:
~visitor()41 	virtual ~visitor() {}
42 };
43 
44 }
45