#pragma once

#include "cardDef.h"

#define OF_ADDON_USING_OFXVECTORMATH
#define OF_ADDON_USING_OFXOPENCV
#define OF_ADDON_USING_OFXXMLSETTINGS

#include "ofMain.h"
#include "ofAddons.h"



class cardManager {
	
	public:
	cardManager(){}
	
	//---------------------------
	void setup(string xmlFile);
	
	
	void saveCardAs(card &theCard, int whichCard);
	bool loadFromXML();
	void loadCardImages();
	bool saveToXML(card &theCard);
	//	void resetCards();
	
	int identifyCardSimple(card &theCard, float matchThresh = 10);
	
	// zach -- hu moment matching opencv style
	int		identifyCardViaHu(card &theCard, float matchThresh = 10);
	int		identifyCardViaPixels(card &theCard, cardImageSet &theCardImageSet);
	
	double  returnShapeMatchFromOpencvMethod( CvHuMoments &a, CvHuMoments &b, int styleOfMatch);  // 1,2,3 style - 
	
	
	
	void draw(vector <card> &cards, float x, float y);

	ofxXmlSettings xml;
	string xmlCardBank;
	
	// TODO get rid of this: 
	card cardBank[52];
	
	ofImage				cardImages[52];			// get em in
	card				newCardBank[52];			// cards
	cardImageSet		newCardBankImages[52];		// images...

};
