/// <summary> /// constructor /// </summary> /// <param name="name"></param> /// <param name="parent"></param> protected AiState(string name, IAiAgent parent) { Validation.IsNotNullOrEmpty(name, "name"); Validation.IsNotNull(parent, "parent"); Name = name; Parent = parent; }
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); }
/// <summary> /// /// </summary> /// <param name="agent"></param> public void Unregister(IAiAgent agent) { Validation.IsNotNull(agent, "agent"); _repository.Keys.Select(key => _repository.Get(key)) .Where(entityList => entityList.Contains(agent)) .ToList() .ForEach(entityList => { entityList.Remove(agent); OnAgentUnregistered?.Invoke(this, null); }); }
/// <summary> /// /// </summary> /// <param name="agent"></param> public void Register(IAiAgent agent) { Validation.IsNotNull(agent, "agent"); var entities = _repository.Get(NextBucket); entities.Add(agent); NextBucket++; if (NextBucket > NumberBuckets) { NextBucket = 1; } OnAgentRegistered?.Invoke(this, null); }
public FakeAiState(string name, IAiAgent parent) : base(name, parent) { }
public AiFightState(IAiAgent parent, DictionaryAtom initAtom) : base("Fight", parent, initAtom) { }
public AiChaseState(IAiAgent parent, DictionaryAtom initAtom) : base("Chase", parent, initAtom) { }
public AiDoNothingState(IAiAgent parent, DictionaryAtom initAtom) : base("DoNothing", parent, initAtom) { }
public AiWanderState(IAiAgent parent, DictionaryAtom initAtom) : base("Wander", parent, initAtom) { }
public AiFleeState(IAiAgent parent, DictionaryAtom initAtom) : base("Flee", parent, initAtom) { }
public AiDeadState(IAiAgent parent, DictionaryAtom initAtom) : base("Dead", parent, initAtom) { }
protected BaseAiState(string name, IAiAgent parent, DictionaryAtom initAtom) : base(name, parent) { }
public AiMoveToState(IAiAgent parent, DictionaryAtom initAtom) : base("MoveTo", parent, initAtom) { }
public AiPatrolState(IAiAgent parent, DictionaryAtom initAtom) : base("Patrol", parent, initAtom) { }