//---------------------------------------------------------------------------
#include "stdafx.h"

using namespace std;

#ifdef _MSC_VER
#pragma hdrstop
#endif

#include "myExcept.h"
#include "PLA_type.h"

//---------------------------------------------------------------------------

PLA_type::PLA_type(void)
{
    f = false;
    d = false;
    r = false;
}

PLA_type::PLA_type( const string type )
{
    unsigned int i;

    f = false;
    d = false;
    r = false;
    for ( i = 0; i < type.size(); i++ )
        if ( type[i] == 'f' ) f = true;
        else if ( type[i] == 'd' ) d = true;
        else if ( type[i] == 'r' ) r = true;
        else throw RuntimeException( "Runtime error: unknown PLA type" );
}

bool PLA_type::operator== ( const PLA_type &_type ) const
{
	if ( this->f != _type.f ) return false;
	if ( this->d != _type.d ) return false;
	if ( this->r != _type.r ) return false;
	return true;
}

bool PLA_type::operator!= ( const PLA_type &_type ) const
{
	if ( this->f != _type.f ) return true;
	if ( this->d != _type.d ) return true;
	if ( this->r != _type.r ) return true;
	return false;
}
