BadZone.cs 619 B

12345678910111213141516171819202122232425262728293031323334
  1. 
  2. namespace MultiAgentSystemPCL
  3. {
  4. public class BadZone : ObjectInWorld
  5. {
  6. protected double radius;
  7. public double Radius
  8. {
  9. get
  10. {
  11. return radius;
  12. }
  13. }
  14. protected int timeToLive = 100;
  15. public BadZone(double _posX, double _posY, double _radius)
  16. {
  17. PosX = _posX;
  18. PosY = _posY;
  19. radius = _radius;
  20. }
  21. public void Update()
  22. {
  23. timeToLive--;
  24. }
  25. public bool Dead()
  26. {
  27. return timeToLive <= 0;
  28. }
  29. }
  30. }