Exemplo n.º 1
0
        public Raven(IMyRemoteControl reference, MyGridProgram program)
        {
            Controller = reference;
            Context    = new ExecutionContext(program, reference);

            SubsystemManager = new SubsystemManager(Context);
            Drive            = new AtmoDrive(Controller);
            CombatLoaderSubsystem loaderSubsystem = new CombatLoaderSubsystem("Drone Cargo", "Drone Store");

            IntelSubsystem intelSubsystem = new IntelSubsystem();

            Context.IntelSystem = intelSubsystem;

            DockingSubsystem         dockingSubsystem       = new DockingSubsystem(intelSubsystem, loaderSubsystem);
            StatusIndicatorSubsystem indicatorSubsystem     = new StatusIndicatorSubsystem(dockingSubsystem, intelSubsystem);
            MonitorSubsystem         monitorSubsystem       = new MonitorSubsystem(intelSubsystem);
            AgentSubsystem           agentSubsystem         = new AgentSubsystem(intelSubsystem, AgentClass.Fighter);
            UndockFirstTaskGenerator undockingTaskGenerator = new UndockFirstTaskGenerator(program, Drive, dockingSubsystem);
            ScannerNetworkSubsystem  scannerSubsystem       = new ScannerNetworkSubsystem(intelSubsystem);
            HornetCombatSubsystem    combatSubsystem        = new HornetCombatSubsystem(intelSubsystem);

            SubsystemManager.AddSubsystem("autopilot", Drive);
            SubsystemManager.AddSubsystem("docking", dockingSubsystem);
            SubsystemManager.AddSubsystem("intel", intelSubsystem);
            SubsystemManager.AddSubsystem("monitor", monitorSubsystem);
            SubsystemManager.AddSubsystem("combat", combatSubsystem);
            SubsystemManager.AddSubsystem("indicator", indicatorSubsystem);
            SubsystemManager.AddSubsystem("loader", loaderSubsystem);

            undockingTaskGenerator.AddTaskGenerator(new WaypointTaskGenerator(program, Drive));
            undockingTaskGenerator.AddTaskGenerator(new DockTaskGenerator(program, Drive, dockingSubsystem));
            undockingTaskGenerator.AddTaskGenerator(new HornetAttackTaskGenerator(program, combatSubsystem, Drive, agentSubsystem, monitorSubsystem, intelSubsystem));

            agentSubsystem.AddTaskGenerator(undockingTaskGenerator);
            agentSubsystem.AddTaskGenerator(new SetHomeTaskGenerator(program, dockingSubsystem));

            SubsystemManager.AddSubsystem("agent", agentSubsystem);
            SubsystemManager.AddSubsystem("scanner", scannerSubsystem);
        }
Exemplo n.º 2
0
        public Hornet(IMyTerminalBlock reference, ExecutionContext context)
        {
            Context = context;

            SubsystemManager = new SubsystemManager(context);

            AutopilotSubsystem autopilotSubsystem = new AutopilotSubsystem();
            IntelSubsystem     intelSubsystem     = new IntelSubsystem();

            Context.IntelSystem = intelSubsystem;

            DockingSubsystem         dockingSubsystem       = new DockingSubsystem(intelSubsystem);
            HornetCombatSubsystem    combatSubsystem        = new HornetCombatSubsystem(intelSubsystem);
            MonitorSubsystem         monitorSubsystem       = new MonitorSubsystem(intelSubsystem);
            StatusIndicatorSubsystem indicatorSubsystem     = new StatusIndicatorSubsystem(dockingSubsystem, intelSubsystem);
            AgentSubsystem           agentSubsystem         = new AgentSubsystem(intelSubsystem, AgentClass.Fighter);
            UndockFirstTaskGenerator undockingTaskGenerator = new UndockFirstTaskGenerator(context.Program, autopilotSubsystem, dockingSubsystem);
            ScannerNetworkSubsystem  scannerSubsystem       = new ScannerNetworkSubsystem(intelSubsystem);

            SubsystemManager.AddSubsystem("autopilot", autopilotSubsystem);
            SubsystemManager.AddSubsystem("docking", dockingSubsystem);
            SubsystemManager.AddSubsystem("intel", intelSubsystem);
            SubsystemManager.AddSubsystem("combat", combatSubsystem);
            SubsystemManager.AddSubsystem("monitor", monitorSubsystem);
            SubsystemManager.AddSubsystem("indicator", indicatorSubsystem);

            undockingTaskGenerator.AddTaskGenerator(new WaypointTaskGenerator(context.Program, autopilotSubsystem));
            undockingTaskGenerator.AddTaskGenerator(new DockTaskGenerator(context.Program, autopilotSubsystem, dockingSubsystem));
            undockingTaskGenerator.AddTaskGenerator(new HornetAttackTaskGenerator(context.Program, combatSubsystem, autopilotSubsystem, agentSubsystem, monitorSubsystem, intelSubsystem));

            agentSubsystem.AddTaskGenerator(undockingTaskGenerator);
            agentSubsystem.AddTaskGenerator(new SetHomeTaskGenerator(context.Program, dockingSubsystem));

            SubsystemManager.AddSubsystem("agent", agentSubsystem);
            SubsystemManager.AddSubsystem("scanner", new ScannerNetworkSubsystem(intelSubsystem));
        }