Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp19
- {
- abstract class Car : ICrashable
- {
- Random rnd = new Random();
- public string make { get; set; }
- public int speed { get; set; }
- public int X { get; private set; }
- public int Lane { get; private set; }
- public char Symobl { get; private set; }
- public void Move()
- {
- }
- public override bool Equals(Car obj)
- {
- if (this.Lane == obj.Lane || this.X == obj.X)
- {
- return true;
- }
- return base.Equals(obj);
- }
- public bool Crashed { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
- public void Crash()
- {
- Crashed = true;
- speed = 0;
- throw new NotImplementedException("Car crashed");
- }
- public void Swerve()
- {
- throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement