Добавлен класс ExtensionDrawingPlane
This commit is contained in:
parent
f03bed65ed
commit
7c1dbb3751
31
ProjectStormtrooper/ExtensionDrawingPlane.java
Normal file
31
ProjectStormtrooper/ExtensionDrawingPlane.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package ProjectStormtrooper;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class ExtensionDrawingPlane {
|
||||||
|
public static DrawingPlane CreateDrawingPlane(String info, String separatorForObject, int width, int height) {
|
||||||
|
String[] strs = info.split(separatorForObject);
|
||||||
|
if (strs.length == 3)
|
||||||
|
{
|
||||||
|
return new DrawingPlane(
|
||||||
|
Integer.parseInt(strs[0]),
|
||||||
|
Integer.parseInt(strs[1]),
|
||||||
|
Color.getColor(strs[2]),
|
||||||
|
width, height
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (strs.length == 6)
|
||||||
|
{
|
||||||
|
return new DrawingStormtrooper(
|
||||||
|
Integer.parseInt(strs[0]),
|
||||||
|
Integer.parseInt(strs[1]),
|
||||||
|
Color.getColor(strs[2]),
|
||||||
|
Color.getColor(strs[3]),
|
||||||
|
Boolean.parseBoolean(strs[4]),
|
||||||
|
Boolean.parseBoolean(strs[5]),
|
||||||
|
width, height
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user