Ejemplo n.º 1
0
    public DockBasic(
        Grid g,
        FsmMemorySpace m,
        List <string> ivn,
        List <string> ovn
        )
    {
        List <string> dockPos = new List <string> ()
        {
            "dockPos"
        };
        List <string> moveArgs = new List <string> ()
        {
            "dockPos", "alt"
        };

        requestDock        = new RequestValueOverRadio(g, m, ivn, dockPos);
        undock             = new Undock(g, m, null, null);
        moveAboveConnector = new MoveBasic(g, m, moveArgs, null);
        dock = new DockPlanetary(g, m, dockPos, null);

        requestDock.setNext(undock.getMe());
        undock.setNext(moveAboveConnector.getMe());
        moveAboveConnector.setNext(dock.getMe());
    }
Ejemplo n.º 2
0
 public Recharge(
     Grid g,
     FsmMemorySpace m,
     List <string> ivn,
     List <string> ovn
     ) : base(g, m, ivn, ovn)
 {
 }
Ejemplo n.º 3
0
 public Undock(
     Grid g,
     FsmMemorySpace m,
     List <string> ivn,
     List <string> ovn
     ) : base(g, m, ivn, ovn)
 {
 }
Ejemplo n.º 4
0
    public MoveBasic(
        Grid g,
        FsmMemorySpace m,
        List <string> ivn,
        List <string> ovn
        )
    {
        goUp       = new goAboveMyPos(g, m, ivn, null);
        goAbovePos = new goAbovePos(g, m, ivn, null);

        goUp.setNext(goAbovePos.getMe());
    }
Ejemplo n.º 5
0
 public FsmStateImplementation(
     Grid argG,
     FsmMemorySpace m,
     List <string> ivn,
     List <string> ovn
     )
 {
     grid        = argG;
     mem         = m;
     inVarNames  = ivn;
     outVarNames = ovn;
 }
Ejemplo n.º 6
0
 public goAboveMyPos(
     Grid g,
     FsmMemorySpace m,
     List <string> ivn,
     List <string> ovn
     ) : base(g, m, ivn, ovn)
 {
     if (ivn.Count < 1)
     {
         throw new Exception(
                   "goAbovePos: true => ivn.Count = " + ivn.Count);
     }
 }
Ejemplo n.º 7
0
 public DockPlanetary(
     Grid g,
     FsmMemorySpace m,
     List <string> ivn,
     List <string> ovn
     ) : base(g, m, ivn, ovn)
 {
     if (ivn.Count < 1)
     {
         throw new Exception("DockPlanetary: ivn.Count = " + ivn.Count);
     }
     grid.gts.GetBlocksOfType(
         connectors, x => x.CubeGrid == grid.Me.CubeGrid);
 }
Ejemplo n.º 8
0
    public static FsmState makeState(
        string name,
        Grid g,
        FsmMemorySpace mem,
        List <string> ia,
        List <string> oa
        )
    {
        switch (name)
        {
        // substates
        case "MoveBasic":
            return(new MoveBasic(g, mem, ia, oa));

        case "DockBasic":
            return(new DockBasic(g, mem, ia, oa));

        // implementations
        case "RequestValueOverRadio":
            return(new RequestValueOverRadio(g, mem, ia, oa));

        case "Undock":
            return(new Undock(g, mem, ia, oa));

        case "Dock":
            return(new Dock(g, mem, ia, oa));

        case "goAboveMyPos":
            return(new goAboveMyPos(g, mem, ia, oa));

        case "goAbovePos":
            return(new goAbovePos(g, mem, ia, oa));

        case "DockPlanetary":
            return(new DockPlanetary(g, mem, ia, oa));

        case "Recharge":
            return(new Recharge(g, mem, ia, oa));

        default:
            return(null);
        }
    }
Ejemplo n.º 9
0
    public RequestValueOverRadio(
        Grid g,
        FsmMemorySpace m,
        List <string> ivn,
        List <string> ovn,
        int retryCnt = 60
        ) : base(g, m, ivn, ovn)
    {
        if (ivn.Count < 2)
        {
            throw new Exception(
                      "RequestValueOverRadio: invalid input var names list");
        }
        if (ovn.Count < 1)
        {
            throw new Exception(
                      "RequestValueOverRadio: invalid output var names list");
        }

        proto = new ProtoRcv(grid);

        cntCap = retryCnt;
    }