#ifndef MDA_EFSM_H_
#define MDA_EFSM_H_

// Author: Steve Talbot

#pragma once


#include "State.h"
#include "Idle.h"
#include "CheckPin.h"
#include "Ready.h"
#include "Overdrawn.h"
#include "Inactive.h"
#include "StateIds.h"
#include "OutputProcessor.h"

#include <vector>

using namespace std;


class MDA_EFSM {

public:

	MDA_EFSM( OutputProcessor* OP_ );
	~MDA_EFSM();

	vector<State*>* getStates();
	void setStates( vector<State*>* states_ );

	State* getCurrentState();

	StateIds* getStateIds();

	void changeState( int stateId_ );

	bool open_account();

	bool correct_login();

	bool incorrect_login();

	bool logout();

	bool correct_pin( bool isAboveMinBalance_, bool isActive_ );

	bool incorrect_pin( bool attemptsRemain_ );

	//bool attempts_remain();		// remove ..

	//bool too_many_attempts();		// remove ..

	//bool active();				// remove ..

	//bool inactive();				// remove ..

	//bool above_min_balance();		// remove ..

	//bool below_min_balance();		// remove ..

	bool activate( bool isPinCorrect_, bool isAboveMinBalance_ );

	bool deactivate( bool isPinCorrect_ );

	bool balance();

	bool withdraw( bool isLessThanMinBalance_ );

	bool deposit( bool isLessThanMinBalance_ );

	//bool diff_more_or_equal_to_min_balance();	// remove ..

	//bool diff_less_than_min_balance();		// remove ..

	//bool sum_more_or_equal_to_min_balance();	// remove ..

	//bool sum_less_than_min_balance();			// remove ..

private:

	vector<State*>* _states;

	State* _currentState;

	StateIds* _stateIds;

};

#endif /*MDA_EFSM_H_*/
