//************************************
// Method:    CreateTicket
// FullName:  BSSlotsContainer::BuildTicket
// Access:    public 
// Returns:   void
// Qualifier: based on real slot symbols to build fake tickets to all reels; Fake reels(top & bottom invisible)
// Parameter: GTArray<int> slotSymbols   :
//************************************
void BSSlotsContainer::BuildTicket(GTArray<int> slotSymbols)
{
#ifdef GT_DEBUG
	GTLogManager::SLogFormatComment("<------------- slot symbols (visible part current 3X5 reels)----------->");	
	GTLogManager::SLogFormatComment(slotSymbols.ToString());
#endif

	//based on real slot symbols to create fake tickets to all reels; 
	//make Fake reels(top & bottom invisible)

	//for exmaple:
	//	2, 3, 5, 6, 5,
	//	5, 5, 5, 8, 1,
	//	4, 3, 3, 3, 3
	//  make 5 reels
	//  reel1: 0, 2, 5, 4, 0
	//  reel2: 0, 3, 5, 3, 0
	// and so on
	GTDictionary<int, GTArray<int>* > reeltickets;

	//initialize
	for(int reelIndex = 0; reelIndex < m_reelColumns.Count(); reelIndex++)
	{
		GTArray<int>* pTickets = new GTArray<int>();
		pTickets->AddToTail(0);	//make fake symbols for top invisible symbols
		reeltickets.Add(reelIndex, pTickets);
	}

	//add reel symbols;
	for(int i = 0; i < slotSymbols.Length(); i++)
	{
		int reelID = i % m_reelColumns.Count();
		int slotSymbolValue = slotSymbols[i];

		GTArray<int>* pTickets = NULL;
		reeltickets.GetValueByKey(reelID, pTickets);		
		pTickets->AddToTail(slotSymbolValue);
	}

	//make fake symbols for top and bottom invisible symbols;
	for(int reelIndex = 0; reelIndex < m_reelColumns.Count(); reelIndex++)
	{
		GTArray<int>* pTickets;
		reeltickets.GetValueByKey(reelIndex, pTickets);
		pTickets->AddToTail(0);		//make fake symbols for bottom invisible symbols

		m_reelColumns[reelIndex]->SetTicket(*pTickets);	//send it to every reel;

		delete pTickets;
	}
	m_slotsSymbols = slotSymbols;
}