/*
 * Stonage: a puzzle game
 * Copyright (C) 2001 Luc Saillard <luc@saillard.org>
 *
 * Routine to start a new game, do transition between each turns ...
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 * 
 */

#ifndef _GAME_H
#define _GAME_H

#include <SDL/SDL.h>
#include "level.h"
#include "stonage.h"

enum game_return_action
{
  GAME_NO_ACTION_DONE,
  GAME_NEED_REFRESH_SCREEN,
  GAME_SQUARE_HAS_MOVED,
  GAME_KINESIST_HAS_MOVED,
  GAME_USER_HAS_MOVED,
  GAME_USER_WANT_TO_QUIT,
  GAME_USER_WIN,
  GAME_USER_LOSE,
};

enum automatic_action
{
  AUTOMATIC_MOVE_SQUARE = SDL_USEREVENT,
  AUTOMATIC_MOVE_DINOSAUR = SDL_USEREVENT+1,
  AUTOMATIC_UPDATE_KINESIST = SDL_USEREVENT+2,
  AUTOMATIC_UPDATE_TIMER = SDL_USEREVENT+3
};

enum game_menu_option
{
  GAME_MENU_ERROR,
  GAME_MENU_START_GAME,
  GAME_MENU_QUIT,
  GAME_MENU_ENTER_LEVEL,
  GAME_MENU_SOUND_OPTION,
  GAME_MENU_CHANGE_DIFFICULTY
};

/* Public structure for the game */
struct t_game
{
  int level; /* Game level */
  int score;
  int candles;
  enum e_difficulty difficulty;  /* difficulty */
  int width,height; /* Size of the window */

  int time_remaining; /* time in sec to complete a level */
  int time_elapsed;   /* time in msec elapsed in the level */
  int game_paused;    /* True when the game is in pause */
  int time_animation; /* last time we have repaint the board */
};

extern struct t_game game;

extern char *datadir_path[];



/* **************************************** */

void Game_SplashScreen(void);
void Game_Quit(void) NO_RETURN;
void Game_Menu_Loop(void);

/* **************************************** */

#endif

