예제 #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;
 }