/*
	Wheels Of Steel
	Copyright (c) 2006, Darragh Coy.
	All rights reserved.
	Original work(s), source code & author(s) details available at: http://www.darraghcoy.com

	Redistribution and use in source and binary forms, with or without modification, are permitted 
	provided that the following conditions are met:

		* 	Redistributions of source code must retain the above copyright notice, this list of 
			conditions and the following disclaimer.
		* 	Redistributions in binary form must reproduce the above copyright notice, this list of 
			conditions and the following disclaimer in the documentation.
		* 	Neither the name of the author nor the names of contributors may be used to endorse or 
			promote products derived from this software without specific prior written permission.
		* 	The use of any third party libraries, modules or data files provided with the source 
			form of the program must follow and respect the individual licensing terms of these 
			components. You do not have permission to modify or circumvent the licensing terms for 
			provided third party components unless the third party licenses specifically allow this. 
			If you do not agree to the terms of provided third party components then you do not have 
			permission to use them in your derived work(s).
		* 	The terms of this license do not apply to separate (but related) distributions if supplied 
			by the author(s), only to the contents of this source distribution, derived works, and the 
			binaries produced by either modified or unmodified versions of the source code. The terms 
			of this license do not also apply to any third party libraries or components provided with 
			the source distribution. Such third party elements are licensed under their own separate 
			agreements.

	THIS SOFTWARE IS PROVIDED BY DARRAGH COY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
	BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
	ARE DISCLAIMED. IN NO EVENT SHALL DARRAGH COY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
	EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
	OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
	OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
	IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MENU_MAIN_H
#define MENU_MAIN_H

//##############################################################################
// Need to include window first to get at 'Window::KeyboardKey'
//##############################################################################

#include "Window.h"

//##############################################################################
// Forward declarations
//##############################################################################

class Game;
class Bitmap;
class BitmapFont;

//##############################################################################
//##############################################################################
//##############################################################################
//##############################################################################
//
//
// Class Name:   Menu_Main
// Purpose:      Shows the main menu. allows user to quit or start a race and
//               change race settings.
//
//##############################################################################
//##############################################################################
//##############################################################################
//##############################################################################

class Menu_Main
{
 /*-----------------------------------------------------------------------------
 Public functions and data
 -----------------------------------------------------------------------------*/

 public:

        //----------------------------------------------------------------------
        // Functions
        //----------------------------------------------------------------------

        // show the main menu

        static void display ( Window * window );

//##############################################################################
//##############################################################################
//##############################################################################
//##############################################################################

 /*-----------------------------------------------------------------------------
 Private functions and data
 -----------------------------------------------------------------------------*/

 private:

        //----------------------------------------------------------------------
        // Enums
        //----------------------------------------------------------------------

        enum MenuItem                   // Which menu item is chosen
        {
            MENU_ITEM_TRACK_LENGHT,
            MENU_ITEM_HILL_STEEPNESS,
            MENU_ITEM_TURN_SHARPNESS,
            MENU_ITEM_NUM_COMPETITORS,
            MENU_ITEM_AI_CAR_SPEED,
            MENU_ITEM_GRID_SPACING
        };

        enum TrackLenght                // How long the track is
        {
            TRACK_LENGHT_SHORT,
            TRACK_LENGHT_NORMAL,
            TRACK_LENGHT_LONG
        };

        enum HillSteepness              // Steep the hills are
        {
            HILL_STEEPNESS_GENTLE,
            HILL_STEEPNESS_NORMAL,
            HILL_STEEPNESS_STEEP
        };

        enum TurnSharpness              // How sharp the turns are
        {
            TURN_SHARPNESS_GENTLE,
            TURN_SHARPNESS_NORMAL,
            TURN_SHARPNESS_SHARP
        };

        enum NumCompetitors             // How many competitors there are (including the player)
        {
            NUM_COMPETITORS_8,
            NUM_COMPETITORS_16,
            NUM_COMPETITORS_24,
            NUM_COMPETITORS_32
        };

        enum AICarSpeed                 // The speed differenece between the AI cars and the players car
        {
            AI_CAR_SPEED_SLOW,
            AI_CAR_SPEED_NORMAL,
            AI_CAR_SPEED_FAST
        };

        enum GridSpacing                // The spacing between competitors on the grid when starting
        {
            GRID_SPACING_NEAR,
            GRID_SPACING_NORMAL,
            GRID_SPACING_FAR
        };

        //----------------------------------------------------------------------
        // Variables
        //----------------------------------------------------------------------

        static bool             runMenu;        // Run the window and consequently the menu ?
        static Bitmap *         bmpArrow;       // The arrow image showing the selected menu item
        static Bitmap *         bmpMenuBar;     // The menu bar horizontal rule divider
        static BitmapFont *     bitFont;        // Bitmap font to use for the screen
        static MenuItem         menuItem;       // Currently selected menu item

        // menu settings

        static TrackLenght      trackLenght;
        static HillSteepness    hillSteepness;
        static TurnSharpness    turnSharpness;
        static NumCompetitors   numCompetitors;
        static AICarSpeed       aiCarSpeed;
        static GridSpacing      gridSpacing;

        //----------------------------------------------------------------------
        // Functions
        //----------------------------------------------------------------------

        static void event_draw      ( Window & window );                            // Draw the menu screen.
        static void event_closed    ( Window & window );                            // Stop running the menu on window closed
        static void event_keyDown   ( Window & window , Window::KeyboardKey key );  // The key down event for the menu

}; // end of: class Menu_Main{}

//##############################################################################
// C++ Includes
//##############################################################################

#include "Game.h"
#include "Bitmap.h"
#include "BitmapFont.h"

#endif // end of: ifndef MENU_MAIN_H
