예제 #1
0
 public LocustAttackTaskGenerator(MyGridProgram program, LocustCombatSystem combatSystem, IAutopilot autopilot, IAgentSubsystem agentSubsystem)
 {
     Program        = program;
     CombatSystem   = combatSystem;
     Autopilot      = autopilot;
     AgentSubsystem = agentSubsystem;
 }
예제 #2
0
        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);
        }
예제 #3
0
        public LocustAttackTask(MyGridProgram program, LocustCombatSystem combatSystem, IAutopilot autopilot, IAgentSubsystem agentSubsystem, MyTuple <IntelItemType, long> intelKey)
        {
            Program        = program;
            CombatSystem   = combatSystem;
            Autopilot      = autopilot;
            AgentSubsystem = agentSubsystem;
            IntelKey       = intelKey;

            Status = TaskStatus.Incomplete;

            LeadTask = new WaypointTask(Program, Autopilot, new Waypoint(), WaypointTask.AvoidObstacleMode.Avoid);
        }