public Program()
        {
            subsystemManager        = new SubsystemManager(this);
            Runtime.UpdateFrequency = UpdateFrequency.Update1;

            // Add subsystems
            AutopilotSubsystem autopilotSubsystem = new AutopilotSubsystem();
            IntelSubsystem     intelSubsystem     = new IntelSubsystem();
            DockingSubsystem   dockingSubsystem   = new DockingSubsystem(intelSubsystem);

            LocustCombatSystem combatSubsystem = new LocustCombatSystem();

            subsystemManager.AddSubsystem("autopilot", autopilotSubsystem);
            subsystemManager.AddSubsystem("docking", dockingSubsystem);
            subsystemManager.AddSubsystem("intel", intelSubsystem);
            subsystemManager.AddSubsystem("combat", combatSubsystem);

            AgentSubsystem           agentSubsystem         = new AgentSubsystem(intelSubsystem, AgentClass.Bomber);
            UndockFirstTaskGenerator undockingTaskGenerator = new UndockFirstTaskGenerator(this, autopilotSubsystem, dockingSubsystem);

            undockingTaskGenerator.AddTaskGenerator(new WaypointTaskGenerator(this, autopilotSubsystem));
            undockingTaskGenerator.AddTaskGenerator(new DockTaskGenerator(this, autopilotSubsystem, dockingSubsystem));

            undockingTaskGenerator.AddTaskGenerator(new LocustAttackTaskGenerator(this, combatSubsystem, autopilotSubsystem, agentSubsystem));

            agentSubsystem.AddTaskGenerator(undockingTaskGenerator);
            agentSubsystem.AddTaskGenerator(new SetHomeTaskGenerator(this, dockingSubsystem));
            subsystemManager.AddSubsystem("agent", agentSubsystem);

            subsystemManager.DeserializeManager(Storage);
        }
        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);
        }
Beispiel #3
0
        public void Do(Dictionary <MyTuple <IntelItemType, long>, IFleetIntelligence> IntelItems, TimeSpan canonicalTime, Profiler profiler)
        {
            if (canonicalTime == TimeSpan.Zero)
            {
                return;
            }

            if (WaitTask.Status == TaskStatus.Incomplete)
            {
                var dockKey = MyTuple.Create(IntelItemType.Dock, DockingSubsystem.Connector.OtherConnector.EntityId);

                if (!IntelItems.ContainsKey(dockKey))
                {
                    WaitTask.Status = TaskStatus.Complete;
                }
                else
                {
                    dock = (DockIntel)IntelItems[dockKey];
                    if ((dock.Status & HangarStatus.Launching) != 0)
                    {
                        WaitTask.Status = TaskStatus.Complete;
                    }
                    else
                    {
                        Program.IGC.SendBroadcastMessage(dock.HangarChannelTag, MyTuple.Create(Program.Me.CubeGrid.EntityId, dock.ID, (int)HangarRequest.RequestLaunch));
                    }
                }
            }
            else
            {
                if (DockingSubsystem.Connector.Status == MyShipConnectorStatus.Connected)
                {
                    DockingSubsystem.Undock();
                }

                AutopilotSubsystem.Drift(Drift);
                AutopilotSubsystem.Controller.DampenersOverride = false;

                var deltaT = canonicalTime - StartTime;

                if ((DockingSubsystem.Connector.WorldMatrix.Translation - (ExpectedPosition + ExpectedVelocity * deltaT.TotalSeconds)).Length() > 80)
                {
                    AutopilotSubsystem.Clear();
                    Status = TaskStatus.Complete;
                }
            }
        }
Beispiel #4
0
        public Program()
        {
            Context = new ExecutionContext(this);

            subsystemManager        = new SubsystemManager(Context);
            Runtime.UpdateFrequency = UpdateFrequency.Update1;

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

            MiningSubsystem     = new HoneybeeMiningSystem();
            LookingGlassNetwork = new LookingGlassNetworkSubsystem(IntelSubsystem, "LG", false, false);
            AgentSubsystem      = new AgentSubsystem(IntelSubsystem, AgentClass.Fighter);
            MonitorSubsystem    = new MonitorSubsystem(IntelSubsystem);
            var loader  = new CombatLoaderSubsystem("Pascal Cargo", "Base Cargo");
            var docking = new DockingSubsystem(IntelSubsystem, loader);

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


            subsystemManager.AddSubsystem("indicator", new StatusIndicatorSubsystem(docking, IntelSubsystem));

            subsystemManager.AddSubsystem("autopilot", AutopilotSubsystem);
            subsystemManager.AddSubsystem("intel", IntelSubsystem);
            subsystemManager.AddSubsystem("mining", MiningSubsystem);
            subsystemManager.AddSubsystem("scanner", ScannerSubsystem);
            subsystemManager.AddSubsystem("lookingglass", LookingGlassNetwork);
            subsystemManager.AddSubsystem("monitor", MonitorSubsystem);
            subsystemManager.AddSubsystem("loader", loader);
            subsystemManager.AddSubsystem("docking", docking);

            var MiningTaskGenerator  = new HoneybeeMiningTaskGenerator(this, MiningSubsystem, AutopilotSubsystem, AgentSubsystem, null, null, null, IntelSubsystem, MonitorSubsystem);
            var HomingTaskGenerator  = new SetHomeTaskGenerator(this, docking);
            var DockingTaskGenerator = new DockTaskGenerator(this, AutopilotSubsystem, docking);

            AgentSubsystem.AddTaskGenerator(MiningTaskGenerator);
            AgentSubsystem.AddTaskGenerator(HomingTaskGenerator);
            AgentSubsystem.AddTaskGenerator(DockingTaskGenerator);

            subsystemManager.AddSubsystem("agent", AgentSubsystem);

            subsystemManager.DeserializeManager(Storage);
        }
        public Program()
        {
            subsystemManager        = new SubsystemManager(this);
            Runtime.UpdateFrequency = UpdateFrequency.Update1;

            // Add subsystems
            IntelSubsystem intelSubsystem = new IntelSubsystem();

            subsystemManager.AddSubsystem("intel", intelSubsystem);
            AutopilotSubsystem autopilotSubsystem = new AutopilotSubsystem();

            subsystemManager.AddSubsystem("autopilot", autopilotSubsystem);
            DockingSubsystem dockingSubsystem = new DockingSubsystem(intelSubsystem);

            subsystemManager.AddSubsystem("docking", dockingSubsystem);
            MonitorSubsystem monitorSubsystem = new MonitorSubsystem(intelSubsystem);

            subsystemManager.AddSubsystem("monitor", monitorSubsystem);

            // LookingGlass setup
            LookingGlassNetworkSubsystem lookingGlassNetwork = new LookingGlassNetworkSubsystem(intelSubsystem, "LG", false, false);

            subsystemManager.AddSubsystem("lookingglass", lookingGlassNetwork);

            // Agent setup
            AgentSubsystem agentSubsystem = new AgentSubsystem(intelSubsystem, AgentClass.Drone);

            intelSubsystem.MyAgent = agentSubsystem;
            UndockFirstTaskGenerator undockingTaskGenerator = new UndockFirstTaskGenerator(this, autopilotSubsystem, dockingSubsystem);

            undockingTaskGenerator.AddTaskGenerator(new WaypointTaskGenerator(this, autopilotSubsystem));
            undockingTaskGenerator.AddTaskGenerator(new DockTaskGenerator(this, autopilotSubsystem, dockingSubsystem));
            agentSubsystem.AddTaskGenerator(undockingTaskGenerator);
            agentSubsystem.AddTaskGenerator(new SetHomeTaskGenerator(this, dockingSubsystem));

            subsystemManager.AddSubsystem("agent", agentSubsystem);

            subsystemManager.AddSubsystem("indicator", new StatusIndicatorSubsystem(dockingSubsystem, intelSubsystem));

            subsystemManager.DeserializeManager(Storage);
        }
Beispiel #6
0
        public Program()
        {
            Context = new ExecutionContext(this);

            subsystemManager        = new SubsystemManager(Context);
            Runtime.UpdateFrequency = UpdateFrequency.Update1;

            // Add subsystems
            AutopilotSubsystem autopilotSubsystem = new AutopilotSubsystem();
            IntelSubsystem     intelSubsystem     = new IntelSubsystem();

            Context.IntelSystem = intelSubsystem;

            DockingSubsystem     dockingSubsystem = new DockingSubsystem(intelSubsystem);
            HoneybeeMiningSystem miningSubsystem  = new HoneybeeMiningSystem();
            MonitorSubsystem     monitorSubsystem = new MonitorSubsystem(intelSubsystem);

            subsystemManager.AddSubsystem("autopilot", autopilotSubsystem);
            subsystemManager.AddSubsystem("docking", dockingSubsystem);
            subsystemManager.AddSubsystem("intel", intelSubsystem);
            subsystemManager.AddSubsystem("mining", miningSubsystem);
            subsystemManager.AddSubsystem("monitor", monitorSubsystem);

            AgentSubsystem agentSubsystem = new AgentSubsystem(intelSubsystem, AgentClass.Miner);

            UndockFirstTaskGenerator undockingTaskGenerator = new UndockFirstTaskGenerator(this, autopilotSubsystem, dockingSubsystem);

            undockingTaskGenerator.AddTaskGenerator(new WaypointTaskGenerator(this, autopilotSubsystem));
            DockTaskGenerator dockTaskGenerator = new DockTaskGenerator(this, autopilotSubsystem, dockingSubsystem);

            undockingTaskGenerator.AddTaskGenerator(dockTaskGenerator);

            agentSubsystem.AddTaskGenerator(undockingTaskGenerator);
            agentSubsystem.AddTaskGenerator(new SetHomeTaskGenerator(this, dockingSubsystem));
            agentSubsystem.AddTaskGenerator(new HoneybeeMiningTaskGenerator(this, miningSubsystem, autopilotSubsystem, agentSubsystem, dockingSubsystem, dockTaskGenerator, undockingTaskGenerator, intelSubsystem, monitorSubsystem));
            subsystemManager.AddSubsystem("agent", agentSubsystem);

            subsystemManager.AddSubsystem("indicator", new StatusIndicatorSubsystem(dockingSubsystem, intelSubsystem));

            subsystemManager.DeserializeManager(Storage);
        }
Beispiel #7
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));
        }