package com.sencorsta.rabs.obj.ai.scene;

import com.sencorsta.rabs.annotation.SceneAnnotation;
import com.sencorsta.rabs.obj.ai.AiManage;
import com.sencorsta.rabs.obj.ai.api.BaseScene;
import com.sencorsta.rabs.obj.ai.api.Scene;
import lombok.Getter;

import java.awt.AWTException;

/**
 * 主场景(走道)
 */
@SceneAnnotation("")
public class SceneMain extends BaseScene implements Scene {
    private static String PathCheck = System.getProperty("user.dir") + "\\opencv\\scene\\check.png";
    @Getter
    private static String PathIp1 = System.getProperty("user.dir") + "\\opencv\\scene\\ip1.png";
    @Getter
    private static String PathIp2 = System.getProperty("user.dir") + "\\opencv\\scene\\ip2.png";
    @Getter
    private static String PathIp3 = System.getProperty("user.dir") + "\\opencv\\scene\\ip3.png";
    @Getter
    private static String PathIp4 = System.getProperty("user.dir") + "\\opencv\\scene\\ip4.png";
    @Getter
    private static String PathIp4Check = System.getProperty("user.dir") + "\\opencv\\scene\\ip4Check.png";

    @Override
    public void back() {
    }

    @Override
    public void open() {
    }

    @Override
    public boolean check() throws AWTException {
        if (checkHas(PathCheck, AiManage.getInstance().getCheckPoint())) {
            return true;
        }
        return false;
    }

    @Override
    public void think() throws Exception {
        if (checkHas(PathIp1, AiManage.getInstance().getCheckPoint())) {
            moveToClick(PathIp1, AiManage.getInstance().getCheckPoint());
        }
    }

    @Override
    public boolean isDone() {
        return hasChildDone();
    }

}
