Added DrawingObjectArtillery serialization and deserialization
This commit is contained in:
parent
ade75a5dc3
commit
8d4407de4c
@ -38,4 +38,16 @@ public class DrawingObjectArtillery implements IDrawingObject {
|
|||||||
public void drawingObject(Graphics2D g) {
|
public void drawingObject(Graphics2D g) {
|
||||||
_artillery.drawTransport(g);
|
_artillery.drawTransport(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInfo() {
|
||||||
|
if (_artillery == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ArtillerySerde.serialize(_artillery);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IDrawingObject create(String data) {
|
||||||
|
return new DrawingObjectArtillery(ArtillerySerde.deserialize(data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,5 @@ public interface IDrawingObject {
|
|||||||
void moveObject(Direction direction);
|
void moveObject(Direction direction);
|
||||||
void drawingObject(Graphics2D g);
|
void drawingObject(Graphics2D g);
|
||||||
float[] getCurrentPosition();
|
float[] getCurrentPosition();
|
||||||
|
String getInfo();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user