Пример #1
0
void Command_Processor::Select_Venue()
{
    Menu* menu = new Menu("Select Venue");
    for (int i = 0; i < *nr_venues; ++i)
    {
		menu->Add_Command(venues[i]->Name());
    }

	menu->Add_Command("Cancel");

    const string* venue_name = menu->Get_Command();

    // Find venue with this name
    for (int i = 0; i <= *nr_venues; ++i)
    {
		if (i < *nr_venues)
		{
			if (venues[i]->Name() == *venue_name)
			{
				selected_venue = venues[i];
				command_state = State_Selected;
				return;
			}
		}
		else
		{
			command_state = Initial;
			return;
		}
    }

    // Should never reach this point.
    cout << "Error in Command_Processor::Select_Venue()\n";
}
Пример #2
0
	 void CommandProcessor::Select_Venue()
	{
		Menu* menu = new Menu("Select Venue");
		
		for (int i = 0; i < nr_venues; ++i)
		{
			menu->Add_Command(venues[i]->Name());
			
		}

		const string* venue_name = menu->Get_Command();

		// Find Venue with this name
		for (int i = 0; i < nr_venues; ++i)
		{
			if (venues[i]->Name() == *venue_name)
			{
				selected_venue = venues[i];
				//command_state = Venue_Selected; 
				command_state = Venue_Option;
				return;
			}
		}
		// Should never reach this point.
		cout << "Error in Command_Processor::Select_State()\n";
	}