//
//  presetManager.mm
//  oscSenderExample
//
//  Created by Robert Tubb on 07/11/2012.
//
//

#include "presetManager.h"

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

PresetManager presetManager;
//---------------------------------------------------------------------------


PresetManager::PresetManager(){
    nextID = 0;
    
}
//---------------------------------------------------------------------------

int PresetManager::addPreset(TwoVector coord, string name){
    // check for same name
    vector<Preset *>::iterator iter;
    for(iter = thePresets.begin(); iter < thePresets.end(); iter++){
        if ((*iter)->name == name){
            cout << " Preset by that name exists\n";
            
            // use exceptions!
            return -1;
        }
    }
    if(name == ""){
        cout << "Please name preset\n";
        return -2;
        
    }
    // check for same coords (!?!)
    thePresets.push_back(new Preset(coord, name,nextID));
    
    // if ok
    return nextID++;
}
//---------------------------------------------------------------------------
vector<TwoVector > getPresetsInRange(TwoVector min, TwoVector max){
    //return all the coordinates. oh and names (displayed at certain scales?).
}
//---------------------------------------------------------------------------
void startupLoadAll(){
  // get stuff from XML  
}
//---------------------------------------------------------------------------
void exitAndSaveAll(){
    
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------