import os
import sys


def append_sys_path():
    root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

    xrl = os.path.join(root, 'build', 'xrl')
    if xrl not in sys.path:
        sys.path.append(xrl)

    xrl_py = os.path.join(root, 'xrl')
    if xrl_py not in sys.path:
        sys.path.append(xrl_py)

    minirts = os.path.join(root, 'build', 'game')
    if minirts not in sys.path:
        sys.path.append(minirts)

    scripts = os.path.join(root, 'scripts')
    if scripts not in sys.path:
        sys.path.append(scripts)

    bc = os.path.join(root, 'scripts', 'behavior_clone')
    if bc not in sys.path:
        sys.path.append(bc)


if __name__ == '__main__':
    # import env for testing
    append_sys_path()
    import torch
    import xrl
    import pyxrl
    import minirts
