#pragma once
#include "Entity.h"
/*--------------------------------ai实体公共头文件--------------------------------*/
#define AISTATION_CREATENAME L"ai_station"
//AI车站
class AiStation :
    public Entity
{
public:
    AiStation();
    void SetState(int stateID, int lr);
    void Step() override;
    std::vector<int> stationID;
    std::vector<int> upper;
    std::vector<int> argbuff;
    bool bSetStationID = true;
    bool bFindUpperEntity = true;
    std::weak_ptr<AiStation> upperEntity;
    std::weak_ptr<AiStation> coreStation;
    int stationType = 0;//0安全区域、1危险区域
    EntityLayer* mainEntityLayer = nullptr;//主层
};
//ai记录基类
class AiRecord :
    public Entity
{
public:
    AiRecord();
    void Step() override;
    void SetState(int stateID, int lr);
    std::vector<int> argbuff;
    std::vector<int> stationID;//属于哪个车站的
    bool decodeRecord = true;//解码记录
    std::vector<GameInput> record;
    std::weak_ptr<AiStation> parentStation;
};

#define AIADJUSTUP_CREATENAME L"ai_adjust_up"
//ai调整向上记录
class AiAdjustUp :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AIDOWNRECORD_CREATENAME L"ai_down_record"
//ai向下移动记录
class AiDownRecord :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AIMOVEEND_CREATENAME L"ai_move_end"
//ai平台边缘
class AiMoveEnd :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AIMOVERECORD_CREATENAME L"ai_move_record"
//ai移动记录
class AiMoveRecord :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AIMOVESTOP_CREATENAME L"ai_move_stop"
//ai停止移动
class AiMoveStop :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AISINGLEBLOCK_CREATENAME L"ai_single_block"
//ai单格平台
class AiSingleBlock :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AIUPRECORD_CREATENAME L"ai_up_record"
//ai向上移动记录
class AiUpRecord :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};

#define AIKEY_CREATENAME L"ai_key"
//ai强制按键
class AiKey :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
    void Step() override;
    GameInput key;
};

#define AIACTION_CREATENAME L"ai_action"
//ai行为
class AiAction :
    public AiRecord
{
public:
    void SetState(int stateID, int lr);
};