public Program() { wndWidth = 50; wndHeight = 40; score = 0; deltaSpeed = 12; Console.SetWindowSize(wndWidth, wndHeight); Console.SetBufferSize(wndWidth, wndHeight); Console.OutputEncoding = Encoding.UTF8; Console.CursorVisible = false; road = new Road(); road.leftSide = 2; controledCar = new ControlledCar(); oncomingCar = new OncomingCar(); controledCar.setLeft(road.rightSide - controledCar.getWidth()); controledCar.setTop(Console.WindowHeight - controledCar.getLength() - 1); }
public Car( Road road, Position position, Position destination, int length = DEFAULT_LENGTH, int width = DEFAULT_WIDTH, int acc = DEFAULT_ACC, int dec = DEFAULT_DEC, int speed = 0) { Length = length; Width = width; Acceleration = acc; Decceleration = dec; Speed = speed; CarId = new CarId(); CurrentRoad = road; CurrentRoad.AddCar(this); Destination = destination; Position = position; }
public void AddIntersection(Position position, Road road) { _intersections.Add(position.Point, road); }