<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     */

    protected $commands = [
        Commands\CustomInterest::class,
        Commands\GameOneMinute::class,
        Commands\GameThreeMinute::class,
        Commands\GameTwoMinute::class,
    ];

    protected function schedule(Schedule $schedule): void
    {
        // if (env('TIME') == 1) {
        //     $schedule->command('custom:game')
        //         ->everyMinute();
        // } else if (env('TIME') == 2) {
        //     $schedule->command('custom:game')
        //         ->everyTwoMinutes();
        // } else if (env('TIME') == 3) {
        //     $schedule->command('custom:game')
        //         ->everyThreeMinutes();
        // } else {
        //     $schedule->command('custom:game')
        //         ->everyTwoMinutes();
        // }

        $schedule->command('game:one')
            ->everyMinute();
        $schedule->command('game:two')
            ->everyTwoMinutes();
        $schedule->command('game:three')
            ->everyThreeMinutes();
        $schedule->command('game:five')
            ->everyFiveMinutes();
        $schedule->command('custom:interest')
            ->daily();
    }

    /**
     * Register the commands for the application.
     */
    protected function commands(): void
    {
        $this->load(__DIR__ . '/Commands');
        require base_path('routes/console.php');
    }
}
