Merge branch 'LabWork02' into LabWork03
# Conflicts: # ProjectCatamaran/src/Drawnings/DrawningBoat.java # ProjectCatamaran/src/Drawnings/DrawningCatamaran.java # ProjectCatamaran/src/Forms/FormCatamaran.java # ProjectCatamaran/src/MovementStrategy/AbstractStrategy.java # ProjectCatamaran/src/MovementStrategy/MoveToBorder.java # ProjectCatamaran/src/MovementStrategy/MoveToCenter.java
This commit is contained in:
commit
702e485daa
@ -107,8 +107,6 @@ public class DrawningBoat {
|
|||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void drawBoat(Graphics g) {
|
public void drawBoat(Graphics g) {
|
||||||
|
@ -13,7 +13,6 @@ public class DrawningOvalPaddles implements IDrawPaddles {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPaddles(Graphics2D g2d, Color color, int _startX, int _startY) {
|
public void drawPaddles(Graphics2D g2d, Color color, int _startX, int _startY) {
|
||||||
g2d.setColor(color);
|
g2d.setColor(color);
|
||||||
|
@ -4,7 +4,6 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class DrawningPaddles implements IDrawPaddles {
|
public class DrawningPaddles implements IDrawPaddles {
|
||||||
private PaddlesCount _paddlesCount;
|
private PaddlesCount _paddlesCount;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNumber(int paddlesCount) {
|
public void setNumber(int paddlesCount) {
|
||||||
for (PaddlesCount value : PaddlesCount.values()) {
|
for (PaddlesCount value : PaddlesCount.values()) {
|
||||||
@ -13,9 +12,7 @@ public class DrawningPaddles implements IDrawPaddles {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPaddles(Graphics2D g2d, Color color, int _startX, int _startY) {
|
public void drawPaddles(Graphics2D g2d, Color color, int _startX, int _startY) {
|
||||||
g2d.setColor(color);
|
g2d.setColor(color);
|
||||||
|
@ -11,5 +11,4 @@ public enum PaddlesCount {
|
|||||||
public int getEnumNumber() {
|
public int getEnumNumber() {
|
||||||
return EnumNumber;
|
return EnumNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,4 @@ public class FormCatamaran extends JFrame {
|
|||||||
controls.add(comboBoxStrategy);
|
controls.add(comboBoxStrategy);
|
||||||
controls.add(buttonStrategyStep);
|
controls.add(buttonStrategyStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public abstract class AbstractStrategy {
|
|||||||
protected boolean MoveDown() { return MoveTo(MovementDirection.Down); }
|
protected boolean MoveDown() { return MoveTo(MovementDirection.Down); }
|
||||||
|
|
||||||
protected ObjectParameters GetObjectParameters() { return _moveableObject.GetObjectPosition(); }
|
protected ObjectParameters GetObjectParameters() { return _moveableObject.GetObjectPosition(); }
|
||||||
// шаг
|
|
||||||
protected int GetStep()
|
protected int GetStep()
|
||||||
{
|
{
|
||||||
if (_state != StrategyStatus.InProgress)
|
if (_state != StrategyStatus.InProgress)
|
||||||
|
@ -3,8 +3,6 @@ import Drawnings.*;
|
|||||||
|
|
||||||
public class MoveableBoat implements IMoveableObject {
|
public class MoveableBoat implements IMoveableObject {
|
||||||
private DrawningBoat _boat = null;
|
private DrawningBoat _boat = null;
|
||||||
|
|
||||||
|
|
||||||
public MoveableBoat(DrawningBoat drawningBoat)
|
public MoveableBoat(DrawningBoat drawningBoat)
|
||||||
{
|
{
|
||||||
_boat = drawningBoat;
|
_boat = drawningBoat;
|
||||||
@ -22,5 +20,4 @@ public class MoveableBoat implements IMoveableObject {
|
|||||||
public int GetStep() { return (int) _boat.getEntityBoat().getStep(); }
|
public int GetStep() { return (int) _boat.getEntityBoat().getStep(); }
|
||||||
public boolean TryMoveObject(MovementDirection direction) { return _boat.moveTransport(direction); }
|
public boolean TryMoveObject(MovementDirection direction) { return _boat.moveTransport(direction); }
|
||||||
public void MoveObject(MovementDirection direction) { _boat.moveTransport(direction); }
|
public void MoveObject(MovementDirection direction) { _boat.moveTransport(direction); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user