#pragma once
#include "EngineFrame/Actor/Actor.h"
class GameMap;
class BaseObject;
class GameMapCamera : public Actor
{
private:
    GameMap *_ParentMap = nullptr;
    // 跟随对象
    BaseObject *_FromActor = nullptr;

public:
    // 摄像机坐标
    int X = 0;
    int Y = 0;
    int Z = 0;
    // 镜头可行坐标
    int MovableAreaX = 0;
    int MovableAreaY = 0;
    // 背景偏移量
    int BackgroundOffset = 0;
    // 背景层移动速率
    int BackgroundMoveSpeed = 1.03;
    // 人物中线长度
    int CharacterLineLength = 0;
    // 摄像机朝向
    int Direction = 1;
    // 摄像机朝向时间
    float DirectionTime = 0.f;
    // 缩放比率
    float CameraRate = 1.0;

public:
    GameMapCamera();
    ~GameMapCamera();

    void SetParentMap(GameMap *map);
    void SetFromActor(BaseObject *actor);
    void Update(float deltaTime);

    void SetPos(int x, int y, int z);
    void AddPos(int x, int y, int z);

    void SyncPosByFromParent(float deltaTime);
};
