﻿#pragma once

#include "Shooting/ImageManager.h"
#include "Shooting/Input.h"
#include "Shooting/EnemyManager.h"
#include "Shooting/EnemyShotManager.h"
#include "Shooting/Player.h"
#include "Shooting/PlayerShotManager.h"

namespace dxgame::shooting
{
    // ゲームに必要なオブジェクトを所有し1フレームの処理を取りまとめる
    class Game
    {
    public:
        // 必須画像を読み込んでゲームループを開始する
        // 画像を読み込めない場合はループを開始せずfalseを返す
        bool Run();

    private:
        // プレイヤーを1フレーム分更新する
        // deltaTimeは移動計算で1フレーム分として使う秒数
        void Update(float deltaTime);

        // プレイヤーを描く
        void Draw() const;

        // プレイヤー弾と敵の命中を判定する
        void ResolveCollisions();

        ImageManager images;
        Input input;
        Player player;
        PlayerShotManager playerShots;
        EnemyManager enemies;
        EnemyShotManager enemyShots;
        int score = 0;
    };
}
