Advertisement
Guest User

Untitled

a guest
May 21st, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp19
  8. {
  9. abstract class Car : ICrashable
  10. {
  11. Random rnd = new Random();
  12.  
  13. public string make { get; set; }
  14. public int speed { get; set; }
  15. public int X { get; private set; }
  16. public int Lane { get; private set; }
  17. public char Symobl { get; private set; }
  18.  
  19. public void Move()
  20. {
  21.  
  22. }
  23.  
  24. public override bool Equals(Car obj)
  25. {
  26. if (this.Lane == obj.Lane || this.X == obj.X)
  27. {
  28. return true;
  29. }
  30. return base.Equals(obj);
  31. }
  32.  
  33. public bool Crashed { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
  34.  
  35. public void Crash()
  36. {
  37. Crashed = true;
  38. speed = 0;
  39. throw new NotImplementedException("Car crashed");
  40. }
  41.  
  42. public void Swerve()
  43. {
  44. throw new NotImplementedException();
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement