示例#1
0
        public Program()
        {
            subsystemManager        = new SubsystemManager(this);
            Runtime.UpdateFrequency = UpdateFrequency.Update1;

            AutopilotSubsystem         = new AutopilotSubsystem();
            AutopilotSubsystem.Persist = true;
            IntelSubsystem             = new IntelSubsystem();
            CombatSubsystem            = new HornetCombatSubsystem(IntelSubsystem);
            LookingGlassNetwork        = new LookingGlassNetworkSubsystem(IntelSubsystem, "LG", false, false);
            AgentSubsystem             = new AgentSubsystem(IntelSubsystem, AgentClass.None);
            TorpedoSubsystem           = new TorpedoSubsystem(IntelSubsystem);
            TaskGenerator = new HornetAttackTaskGenerator(this, CombatSubsystem, AutopilotSubsystem, AgentSubsystem, null, IntelSubsystem);
            AgentSubsystem.AddTaskGenerator(TaskGenerator);
            TaskGenerator.HornetAttackTask.FocusedTarget = true;
            CombatLoaderSubsystem = new CombatLoaderSubsystem("Fermi Cargo", "Combat Supplies");

            ScannerSubsystem = new ScannerNetworkSubsystem(IntelSubsystem);
            LookingGlassNetwork.AddPlugin("combat", new LookingGlass_Heisenberg(this));

            subsystemManager.AddSubsystem("autopilot", AutopilotSubsystem);
            subsystemManager.AddSubsystem("intel", IntelSubsystem);
            subsystemManager.AddSubsystem("combat", CombatSubsystem);
            subsystemManager.AddSubsystem("agent", AgentSubsystem);
            subsystemManager.AddSubsystem("scanner", ScannerSubsystem);
            subsystemManager.AddSubsystem("lookingglass", LookingGlassNetwork);

            subsystemManager.DeserializeManager(Storage);
        }
示例#2
0
        public HornetAttackTaskGenerator(MyGridProgram program, HornetCombatSubsystem combatSystem, IAutopilot autopilot, IAgentSubsystem agentSubsystem, IMonitorSubsystem monitorSubsystem, IIntelProvider intelProvider)
        {
            Program          = program;
            CombatSystem     = combatSystem;
            Autopilot        = autopilot;
            AgentSubsystem   = agentSubsystem;
            MonitorSubsystem = monitorSubsystem;
            IntelProvider    = intelProvider;

            HornetAttackTask = new HornetAttackTask(Program, CombatSystem, Autopilot, AgentSubsystem, MonitorSubsystem, IntelProvider);
            HornetAttackTask.Do(new Dictionary <MyTuple <IntelItemType, long>, IFleetIntelligence>(), TimeSpan.Zero, null);
        }
示例#3
0
//        int targetLastPoweredRun = 0;

        public HornetAttackTask(MyGridProgram program, HornetCombatSubsystem combatSystem, IAutopilot autopilot, IAgentSubsystem agentSubsystem, IMonitorSubsystem monitorSubsystem, IIntelProvider intelProvider)
        {
            Program          = program;
            CombatSystem     = combatSystem;
            Autopilot        = autopilot;
            AgentSubsystem   = agentSubsystem;
            MonitorSubsystem = monitorSubsystem;
            IntelProvider    = intelProvider;

            Status = TaskStatus.Incomplete;

            LeadTask = new WaypointTask(Program, Autopilot, new Waypoint(), WaypointTask.AvoidObstacleMode.Avoid);
        }
示例#4
0
//         {
//             { MyItemType.MakeComponent("SteelPlate"), 87} ,
//             { MyItemType.MakeComponent("Construction"), 47} ,
//             { MyItemType.MakeComponent("LargeTube"), 5} ,
//             { MyItemType.MakeComponent("Motor"), 10} ,
//             { MyItemType.MakeComponent("Computer"), 37} ,
//             { MyItemType.MakeComponent("MetalGrid"), 4} ,
//             { MyItemType.MakeComponent("SmallTube"), 14} ,
//             { MyItemType.MakeComponent("InteriorPlate"), 2} ,
//             { MyItemType.MakeComponent("Girder"), 1} ,
//             { MyItemType.MakeComponent("Explosives"), 2} ,
//             { MyItemType.MakeComponent("PowerCell"), 2} ,
//         };
        public Program()
        {
            Context                 = new ExecutionContext(this);
            subsystemManager        = new SubsystemManager(Context);
            Runtime.UpdateFrequency = UpdateFrequency.Update1;

            GridTerminalSystem.GetBlocksOfType <IMyTerminalBlock>(null, CollectBlocks);
            AutopilotSubsystem          = new AtmoDrive(Controller, 5, Me);
            AutopilotSubsystem.FullAuto = false;

            IntelSubsystem      = new IntelSubsystem();
            Context.IntelSystem = IntelSubsystem;

            CombatSubsystem     = new HornetCombatSubsystem(IntelSubsystem, false);
            LookingGlassNetwork = new LookingGlassNetworkSubsystem(IntelSubsystem, "LG", false, false);
            AgentSubsystem      = new AgentSubsystem(IntelSubsystem, AgentClass.None);
            TaskGenerator       = new HornetAttackTaskGenerator(this, CombatSubsystem, AutopilotSubsystem, AgentSubsystem, null, IntelSubsystem);
            AgentSubsystem.AddTaskGenerator(TaskGenerator);
            TaskGenerator.HornetAttackTask.FocusedTarget = true;
            CombatLoaderSubsystem = new CombatLoaderSubsystem();
            //DockingSubsystem = new DockingSubsystem(IntelSubsystem, CombatLoaderSubsystem);
            TorpedoSubsystem = new TorpedoSubsystem(IntelSubsystem);

            ScannerSubsystem = new ScannerNetworkSubsystem(IntelSubsystem);
            LookingGlassNetwork.AddPlugin("combat", new LookingGlass_Fermi(this));

            subsystemManager.AddSubsystem("autopilot", AutopilotSubsystem);
            subsystemManager.AddSubsystem("intel", IntelSubsystem);
            subsystemManager.AddSubsystem("combat", CombatSubsystem);
            subsystemManager.AddSubsystem("agent", AgentSubsystem);
            subsystemManager.AddSubsystem("scanner", ScannerSubsystem);
            subsystemManager.AddSubsystem("lookingglass", LookingGlassNetwork);
            subsystemManager.AddSubsystem("loader", CombatLoaderSubsystem);
//            subsystemManager.AddSubsystem("docking", DockingSubsystem);
            subsystemManager.AddSubsystem("torpedo", TorpedoSubsystem);

            subsystemManager.DeserializeManager(Storage);

            ParseConfigs();
        }
示例#5
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);
        }
示例#6
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));
        }