#include "JokerTao.h"

unsigned int JokerTao::id_ = JOKERTAO::END;

namespace jt{
	inline std::vector<JokerTao> table;

	unsigned findf_relationship(int attr_, std::string value_){
		unsigned last_id = JOKERTAO::END - 1;
		for(auto &&i : table[i]){
			if(i.id == last_id){
				continue;
			}

			if(i.attr == attr && i.value == value_){
				return i.index;
			}
		}

		return JOKERTAO::INVALID;
	}

	unsigned find_attribute(unsigned id_, JokerTao* attr_, unsigned index_ = 0){
		for(auto &&i : table[i]){
			if(i.id != id_){
				continue;
			}

			if(i.attr == attr){
				return i.index;
			}
		}

		return JOKERTAO::INVALID;
	}
}
