import express from 'express';
import TaxiController from '../controllers/taxiController.js';
import { authenticate } from '../middleware/authMiddleware.js';

const router = express.Router();
const taxiController = new TaxiController();

// Alle Routen erfordern Authentifizierung
router.use(authenticate);

// Spielstand-Routen
router.get('/game-state', (req, res) => taxiController.getGameState(req, res));
router.post('/game-state', (req, res) => taxiController.saveGameState(req, res));

// Level-Routen
router.get('/level/:level/stats', (req, res) => taxiController.getLevelStats(req, res));
router.post('/level/unlock', (req, res) => taxiController.unlockLevel(req, res));
router.post('/level/reset', (req, res) => taxiController.resetLevel(req, res));

// Spiel-Routen
router.post('/finish', (req, res) => taxiController.finishGame(req, res));

// Statistik-Routen
router.get('/leaderboard', (req, res) => taxiController.getLeaderboard(req, res));
router.get('/player-stats', (req, res) => taxiController.getPlayerStats(req, res));

// Reset-Routen
router.post('/reset-all', (req, res) => taxiController.resetAllProgress(req, res));

export default router;
