Ejemplo n.º 1
0
 public Conveyor(MachineConnector output, MachineConnector input)
 {
     _output = output;
     _input  = input;
     _start  = _output.GetWorldPositionOneTileOut();
     _end    = _input.GetWorldPositionOneTileOut();
 }
Ejemplo n.º 2
0
    public void InitializeTestSlots()
    {
        _inputs  = new MachineConnector[1];
        _outputs = new MachineConnector[1];

        for (int i = 0; i < _inputs.Length; ++i)
        {
            MachineConnector conn = new MachineConnector();
            conn._localDir = Direction.Left;
            _inputs[i]     = conn;
        }

        for (int i = 0; i < _outputs.Length; ++i)
        {
            MachineConnector conn = new MachineConnector();
            conn._localDir = Direction.Right;
            conn._local.X  = GetSize().X - 1;
            conn._local.Y  = GetSize().Y - 1;
            _outputs[i]    = conn;
        }
    }
Ejemplo n.º 3
0
    public static Conveyor ConnectMachines(MachineConnector output, MachineConnector input)
    {
        if (output != null &&
            input != null)
        {
            Conveyor c = new Conveyor(output, input);

            output._conveyor = c;
            input._conveyor  = c;

            Map map = new Map();
            map._conveyors      = _instance.m_conveyors;
            map.Machines        = _instance.m_machines;
            map.BuildingInputs  = _instance.m_machines.SelectMany(x => x._inputs).ToList();
            map.BuildingOutputs = _instance.m_machines.SelectMany(x => x._outputs).ToList();
            map.Machines        = _instance.m_machines;
            map.Height          = 20;
            map.Width           = 40;

            _instance.m_conveyors.Add(c);

            if (Autorouter.Autoroute(map, c))
            {
                return(c);
            }
            else
            {
                DisconnectMachines(c);
                return(null);
            }
        }
        else
        {
            return(null);
        }
    }
 public void SetUpTestMachineConnector()
 {
     m_machineInfoMgr   = new MachineInfoMgr();
     m_testNetClient    = new TestNetClient();
     m_machineConnector = new MachineConnector(m_machineInfoMgr, m_testNetClient);
 }
Ejemplo n.º 5
0
 static public void RecreateObjectReferences()
 {
     //dataLoader = new DHTDataLoader(LocalWebServerUrl);
     //anomalyDetector = new AnomalyDetector(TempMean, TempStdDev, HumMean, HumStdDev);
     machineConnector = new MachineConnector($"{InteractionWebServerUrl}");
 }