Пример #1
0
 public InfanteryMindProcessor(IOrientationService orientationService, IPathfindingService pathfindingService, IEventAgent eventAgent, IHeatMapService heatMapService)
 {
     _orientationService = orientationService;
     _pathfindingService = pathfindingService;
     _eventAgent = eventAgent;
     _heatMapService = heatMapService;
 }
Пример #2
0
 public WorkflowProvider(SynchronizationContext context, IEventBroker eventBroker, ITrackingParticipant tracking, IMessageAgent agent, IEventAgent eventAgent)
 {
     _context     = context;
     _eventBroker = eventBroker;
     _tracking    = tracking;
     _agent       = agent;
     _eventAgent  = eventAgent;
 }
Пример #3
0
 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>();
 }
Пример #4
0
 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>();
 }
Пример #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)
                                                         };
 }
Пример #6
0
 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;
 }
Пример #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);
        }
Пример #8
0
 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);
 }
Пример #9
0
 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;
        }
Пример #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}
                   };
 }
Пример #12
0
        private List <IEventAgent> gameEventAgentList = new List <IEventAgent>(30);//根据项目中的事件数量调整

        public void AddEventAgent(IEventAgent agent)
        {
            gameEventAgentList.Add(agent);
        }
Пример #13
0
 public ProductionHandler(IArtificialIntelligence ai, IEventAgent eventAgent, PositionHandler positionHandler)
 {
     _ai = ai;
     _eventAgent = eventAgent;
     _positionHandler = positionHandler;
 }
Пример #14
0
 protected StrategyBase(IEventAgent agent)
 {
     Agent = agent;
 }
Пример #15
0
 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) };
 }
Пример #16
0
 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) };
 }
Пример #17
0
 protected ArtificialIntelligenceBase(IEventAgent eventAgent, string id)
 {
     Id = id;
     EventAgent = eventAgent;
 }