//
// C++ Interface: osd_userinterface_matchdetails
//
// Description:
//
//
// Author: Matthias Feistel <hitman_47@users.sourceforge.net>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//

#include "osd_userinterface_matchdetails.h"
#include "settings.h"
#include "debug.h"
#include "utils.h"
#include <map>


// --- cUserInterface_matchdetails ---------------------------------------------------------

cUserInterface_matchdetails::cUserInterface_matchdetails(long MatchID)
        :cMenuText("", "")
{
    m_MatchID = MatchID;
    Set();
}

void cUserInterface_matchdetails::Set()
{
    std::map<long, cTeamData> TeamdataMap = cSettings::GetInstance( ).GetTeamContainer( );
    std::map<const long, cTeamData>::iterator el = TeamdataMap.find( m_MatchID );
    cTeamData teamdata = el->second;
    std::map<int, cEventList> EventListMap = teamdata.EventContainer;
    std::map<int, cEventList>::iterator el_Event;
    std::string s;

    Clear();
    SetTitle( itoa( m_MatchID ) );

    for( el_Event = EventListMap.begin(); el_Event != EventListMap.end(); el_Event++ )
    {
        s.append( el_Event->second.EventText );


    }

	cUtils::html2text( s, s );  // HTML-Code entfernen
    SetText( s.c_str() );

    Display();
}
