PIbd-21_Kouvshinoff_T._A._W.../laba1Loco/EntityTrain.java
2023-10-08 01:10:54 +04:00

45 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package laba1Loco;
import java.awt.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
import java.awt.event.*;
public class EntityTrain {
/// <summary>
/// Скорость
/// </summary>
public int Speed;
/// <summary>
/// Вес
/// </summary>
public double Weight;
/// <summary>
/// Основной цвет
/// </summary>
public Color BodyColor;
/// <summary>
/// Шаг перемещения поезда
/// </summary>
public double Step;
/// <summary>
/// количество колёс [2;4]
/// </summary>
public int numWheel;
/// <summary>
/// Инициализация полей объекта-класса Локомотива
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес автомобиля</param>
/// <param name="bodyColor">Основной цвет</param>
public EntityTrain(int speed, double weight, Color bodyColor, int _numWheel)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
numWheel = _numWheel;
Step = (double)Speed * 100 / Weight;
}
}