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
| #ifndef CONTROLER_H_INCLUDED
#define CONTROLER_H_INCLUDED
#include "Model.h"
#include "Input.h"
//===============================
// CLASS CONTROLER VIRTUAL
//-------------------------------
class Controler
{
public:
// VIRTUAL DESTRUCTOR
virtual ~Controler() {}
// WORK FUNCTION
virtual void work( const Input& input, Model& model ) = 0;
};
//===============================
// CONTROLER SUMMARY
//-------------------------------
class Controler_Summary : public Controler
{
void work( const Input& input, Model& model )
{
if( input == "0" )
model.program_exit();
else if( input == "1" )
model.page_move( PageId::PROGRAM_OPTIONS );
}
};
//===============================
// CONTROLER OPTIONS
//-------------------------------
class Controler_Options : public Controler
{
void work( const Input& input, Model& model )
{
if( input == "0" )
model.page_move( PageId::PROGRAM_SUMMARY );
}
};
#endif // CONTROLER_H_INCLUDED |