Изменение интерфейса IDrawningObject и его реализации DrawningObjectLocomotive
This commit is contained in:
parent
1812efd16e
commit
0ca1f9efcb
@ -180,7 +180,7 @@ public class DrawningLocomotive {
|
|||||||
if (strs[5] == "Simple") drawningExtra = new ExtraWheelsDraw(Integer.parseInt(strs[6]), Locomotive.getBodyColor());
|
if (strs[5] == "Simple") drawningExtra = new ExtraWheelsDraw(Integer.parseInt(strs[6]), Locomotive.getBodyColor());
|
||||||
if (strs[5] == "Star") drawningExtra = new ExtraStarWheelDraw(Integer.parseInt(strs[6]), Locomotive.getBodyColor());
|
if (strs[5] == "Star") drawningExtra = new ExtraStarWheelDraw(Integer.parseInt(strs[6]), Locomotive.getBodyColor());
|
||||||
if (strs[5] == "Round") drawningExtra = new ExtraRoundWheelDraw(Integer.parseInt(strs[6]), Locomotive.getBodyColor());
|
if (strs[5] == "Round") drawningExtra = new ExtraRoundWheelDraw(Integer.parseInt(strs[6]), Locomotive.getBodyColor());
|
||||||
if (drawningExtra == null)
|
if (drawningExtra == null) return null;
|
||||||
if (strs.length == 7)
|
if (strs.length == 7)
|
||||||
{
|
{
|
||||||
Locomotive = new EntityLocomotive(
|
Locomotive = new EntityLocomotive(
|
||||||
|
@ -39,4 +39,9 @@ public class DrawningObjectLocomotive implements IDrawningObject {
|
|||||||
{
|
{
|
||||||
if (_locomotive != null) _locomotive.SetPosition(x, y, width, height);
|
if (_locomotive != null) _locomotive.SetPosition(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInfo(){
|
||||||
|
if (_locomotive == null) return null;
|
||||||
|
return _locomotive.getDataForSave();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,9 @@ public interface IDrawningObject {
|
|||||||
void MoveObject(Direction direction);
|
void MoveObject(Direction direction);
|
||||||
/// Отрисовка объекта
|
/// Отрисовка объекта
|
||||||
void DrawningObject(Graphics g);
|
void DrawningObject(Graphics g);
|
||||||
|
|
||||||
|
String getInfo();
|
||||||
|
|
||||||
/// Получение текущей позиции объекта
|
/// Получение текущей позиции объекта
|
||||||
float[] GetCurrentPosition();
|
float[] GetCurrentPosition();
|
||||||
//0 - up
|
//0 - up
|
||||||
|
Loading…
Reference in New Issue
Block a user