public InfanteryMindProcessor(IOrientationService orientationService, IPathfindingService pathfindingService, IEventAgent eventAgent, IHeatMapService heatMapService)
 {
     _orientationService = orientationService;
     _pathfindingService = pathfindingService;
     _eventAgent = eventAgent;
     _heatMapService = heatMapService;
 }
Beispiel #2
0
 public WorkflowProvider(SynchronizationContext context, IEventBroker eventBroker, ITrackingParticipant tracking, IMessageAgent agent, IEventAgent eventAgent)
 {
     _context     = context;
     _eventBroker = eventBroker;
     _tracking    = tracking;
     _agent       = agent;
     _eventAgent  = eventAgent;
 }
 public ArtificialIntelligenceJfi(IEventAgent eventAgent, string id)
     : base(eventAgent, id)
 {
     _app = new App(new AIDto {EventAgent = eventAgent, Id = id, AI = this});
     _eventProcessor = _app.Kernel.Get<IEventProcessor>();
     _strategyProcessor = _app.Kernel.Get<ICHProcessor<Strategy>>();
     _strategieFactory = _app.Kernel.Get<IStrategieFactory>();
     _componentService = _app.Kernel.Get<ComponentService>();
 }
 public ProductionServiceBase(string senderId,IProductionFacilityProvider productionFacilityProvider, IComponentService componentService,IOrientationService orientationService, IEventAgent eventAgent)
 {
     SenderId = senderId;
     ProductionFacilityProvider = productionFacilityProvider;
     ComponentService = componentService;
     OrientationService = orientationService;
     EventAgent = eventAgent;
     ProductionRules = new List<IProductionRule>();
 }
Beispiel #5
0
 public ProductionManager(IComponentService componentService, IProductionFacilityProvider productionFacilityProvider,IOrientationService orientationService, IEventAgent eventAgent, string senderId)
 {
     EventAgent = eventAgent;
     ComponentService = componentService;
     OrientationService = orientationService;
     ProductionServices = new List<IProductionService>() {
                                                             new BarrackProductionService(senderId,productionFacilityProvider,ComponentService,OrientationService,eventAgent),
                                                             new InfanteryProductionService(senderId,productionFacilityProvider,ComponentService,OrientationService,eventAgent)
                                                         };
 }
 public ArtificialIntelligenceSpa(IEventAgent eventAgent, string id)
     : base(eventAgent, id)
 {
     _strategy = new FirstStrategy(eventAgent);
     _eventDelegator = new EventDelegator();
     _eventProcessor = new SpaEventProcessor(_eventDelegator);
     _eventDelegator.ProductCreated = _strategy.ProductCompleted;
     _eventDelegator.InfanterySpotted = _strategy.EnemyContact;
     _eventDelegator.InfanteryReachedPosition = _strategy.ReachedPosition;
     _eventDelegator.UnitLost = _strategy.UnitLost;
 }
Beispiel #7
0
        public MovementService(IComponentService componentService, IEventAgent eventAgent
            , IOrientationService orientationService, InfanteryMindStateService infanteryMindStateService, IHeatMapService heatMapService)
        {
            _componentService = componentService;

            _eventAgent = eventAgent;
            _orientationService = orientationService;
            _infanteryMindStateService =infanteryMindStateService;
            _heatMapService = heatMapService;
            _infanteryMindProcessor = new InfanteryMindProcessor(_orientationService, new PathfindingService(), _eventAgent,_heatMapService);
        }
 public ArtificialIntelligenceNhu(IEventAgent eventAgent, string id)
     : base(eventAgent, id)
 {
     ComponentService = new ComponentService();
     EventProcessor = new AiEventProcessor(ComponentService);
     OrientationService = new OrientationService(new Vector2(0,0),ComponentService);
     var productionManager = new ProductionManager(ComponentService, new ProductionFacilityProvider(ComponentService), OrientationService,eventAgent, id);
     HeatMapService = new HeatMapService(new HeatPortionCalculationService(),new Vector2(800,800));
     HeatMapService.Initialize();
     InfanteryMindStateService = new InfanteryMindStateService(EventProcessor as AiEventProcessor,HeatMapService,ComponentService);
     var movementService = new MovementService(ComponentService, EventAgent, OrientationService, InfanteryMindStateService,HeatMapService);
     Agent = new AiAgent(ComponentService, productionManager, movementService, InfanteryMindStateService, HeatMapService);
 }
 public ArtificialIntelligenceNku(IEventAgent eventAgent, string id)
     : base(eventAgent, id)
 {
     ComponentService = new ComponentService();
     EventHandler = new EventHandler(this, ComponentService);
     EventHandler.HeadquarterCompleted += EventHandler_HeadquarterCompleted;
     EventHandler.MovementCompleted += EventHandler_MovementCompleted;
     EventHandler.TargetPositionBlocked += EventHandler_TargetPositionBlocked;
     EventHandler.ComponentSpotted += EventHandlerOnComponentSpotted;
     EventHandler.ProductionCompleted += EventHandler_ProductionCompleted;
     EventHandler.ComponentDestroyed += EventHandler_ComponentDestroyed;
     EventHandler.ComponentLost += EventHandler_ComponentLost;
     BuildOrder = new RushBuildOrder(EventHandler);
     BuildOrder.Create();
 }
        public PowerSupplayVisualComponent(IEventBroker eventBroker, IMessageAgent messageAgent, IEventAgent eventAgent)
        {
            _eventBroker  = eventBroker;
            _messageAgent = messageAgent;
            _eventAgent   = eventAgent;

            EnableCommand = new RelayCommand(
                param => Enable(),
                param => CanEnable);

            DisableCommand = new RelayCommand(
                param => Disable(),
                param => CanDisable);

            CanEnable  = true;
            CanDisable = false;
            U          = 0;
        }
Beispiel #11
0
 public FirstStrategy(IEventAgent agent)
     : base(agent)
 {
     ProductCompleted += NewBuilding;
     EnemyContact += Alert;
     ReachedPosition += Reached;
     UnitLost += Lost;
     _timer.AutoReset = true;
     _timer.Enabled = true;
     _timer.Elapsed += _timer_Elapsed;
     targets = new List<Target>()
                   {
                       new Target() {X = 20, Y = 32},
                       new Target() {X = 20, Y = 20},
                       new Target() {X = 930, Y = 32},
                       new Target() {X = 980, Y = 980},
                       new Target() {X = 32, Y = 710},
                       new Target() {X = 32, Y = 980},
                       new Target() {X = 990, Y = 990}
                   };
 }
Beispiel #12
0
        private List <IEventAgent> gameEventAgentList = new List <IEventAgent>(30);//根据项目中的事件数量调整

        public void AddEventAgent(IEventAgent agent)
        {
            gameEventAgentList.Add(agent);
        }
Beispiel #13
0
 public ProductionHandler(IArtificialIntelligence ai, IEventAgent eventAgent, PositionHandler positionHandler)
 {
     _ai = ai;
     _eventAgent = eventAgent;
     _positionHandler = positionHandler;
 }
Beispiel #14
0
 protected StrategyBase(IEventAgent agent)
 {
     Agent = agent;
 }
 public InfanteryProductionService(string senderId, IProductionFacilityProvider productionFacilityProvider, IComponentService componentService, IOrientationService orientationService, IEventAgent eventAgent)
     : base(senderId, productionFacilityProvider, componentService, orientationService, eventAgent)
 {
     ProductionRules = new List<IProductionRule>() { new BarrackAvailableRule(ComponentService), new LessThandNeededInfanteryRule(ComponentService) };
 }
 public BarrackProductionService(string senderId, IProductionFacilityProvider productionFacilityProvider, IComponentService componentService, IOrientationService orientationService, IEventAgent eventAgent)
     : base(senderId, productionFacilityProvider, componentService, orientationService, eventAgent)
 {
     ProductionRules = new List<IProductionRule>() { new NoBarracksAvailableRule(ComponentService) };
 }
 protected ArtificialIntelligenceBase(IEventAgent eventAgent, string id)
 {
     Id = id;
     EventAgent = eventAgent;
 }