<?php

/*
 * Home page
 */
Route::get(array('/', 'home'), function() {
	return View::home();
});

/*
 * Lobby page
 */
Route::get(array('/lobby', 'lobby'), function() {
    return View::lobby();
});

/*
 * How to play
 */
Route::get(array('/how-to-play', 'how-to-play'), function() {
    return View::how_to_play();
});

/*
 * Credits
 */
Route::get(array('/credits', 'credits'), function() {
    return View::credits();
});
Route::get(array('/menu', 'menu'), function() {
    return View::menu();
});
Route::get(array('/api/player-list','api/player-list'), function() {
    return View::player_list();
});

Route::get(array('/api/who-am-i','api/who-am-i'), function() {
    return View::who_am_i();
});

Route::get(array('/api/player-info','api/player-info'), function() {
    return View::player_info($_GET);
});

Route::get(array('/api/delete-game','api/delete-game'), function() {
    $game = SpaceDrift\Game::Instance();
    $game->deleteGame();
});

/*
 * 404 not found
 */
Route::not_found(function() {
	return Response::error(404);
});


