You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AgEngineEffector.cs 786B

12345678910111213141516171819202122232425262728293031
  1. using Microsoft.Extensions.Options;
  2. using uqac_ia_aspirobot.Extensions;
  3. namespace uqac_ia_aspirobot.Agent.Effectors
  4. {
  5. public class AgEngineEffector
  6. {
  7. private readonly AgBatterySensor _agBatterySensor;
  8. private readonly AgConfig _options;
  9. public int X { get; protected set; }
  10. public int Y { get; protected set; }
  11. public AgEngineEffector(IOptions<AgConfig> options, AgBatterySensor agBatterySensor)
  12. {
  13. _agBatterySensor = agBatterySensor;
  14. _options = options.Value;
  15. X = _options.StartX;
  16. Y = _options.StartY;
  17. }
  18. public void MoveTo(int x, int y)
  19. {
  20. _agBatterySensor.Add(this.Distance(x, y));
  21. X = x;
  22. Y = y;
  23. }
  24. }
  25. }