some minor fixes
This commit is contained in:
parent
5c97eb3db4
commit
4ff33ecdf2
@ -1,3 +1,5 @@
|
|||||||
|
import frames.FrameBattleship;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
package drawing_objects;
|
||||||
|
|
||||||
|
import entities.EntityBattleship;
|
||||||
|
import enums.DirectionType;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class DrawingBattleship {
|
public class DrawingBattleship {
|
||||||
@ -86,7 +91,9 @@ public class DrawingBattleship {
|
|||||||
graphics2D.drawRect(startPosX + 70, startPosY + 12, 18, 26);
|
graphics2D.drawRect(startPosX + 70, startPosY + 12, 18, 26);
|
||||||
graphics2D.drawOval(startPosX + 94, startPosY + 19, 12, 12);
|
graphics2D.drawOval(startPosX + 94, startPosY + 19, 12, 12);
|
||||||
//блоки
|
//блоки
|
||||||
drawingBlocks.drawBlocks(graphics2D, startPosX, startPosY);
|
if (drawingBlocks != null){
|
||||||
|
drawingBlocks.drawBlocks(graphics2D, startPosX, startPosY);
|
||||||
|
}
|
||||||
//орудийная башня
|
//орудийная башня
|
||||||
if (entityBattleship.getTurret()) {
|
if (entityBattleship.getTurret()) {
|
||||||
int[] shieldX = new int[] {startPosX + 112, startPosX + 112, startPosX + 119, startPosX + 119, };
|
int[] shieldX = new int[] {startPosX + 112, startPosX + 112, startPosX + 119, startPosX + 119, };
|
@ -1,3 +1,7 @@
|
|||||||
|
package drawing_objects;
|
||||||
|
|
||||||
|
import enums.BlocksNumber;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class DrawingBlocks {
|
public class DrawingBlocks {
|
@ -1,3 +1,5 @@
|
|||||||
|
package entities;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
package enums;
|
||||||
|
|
||||||
public enum BlocksNumber {
|
public enum BlocksNumber {
|
||||||
TWO,
|
TWO,
|
||||||
FOUR,
|
FOUR,
|
@ -1,3 +1,5 @@
|
|||||||
|
package enums;
|
||||||
|
|
||||||
public enum DirectionType {
|
public enum DirectionType {
|
||||||
UP,
|
UP,
|
||||||
DOWN,
|
DOWN,
|
@ -1,3 +1,8 @@
|
|||||||
|
package frames;
|
||||||
|
|
||||||
|
import drawing_objects.DrawingBattleship;
|
||||||
|
import enums.DirectionType;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@ -5,6 +10,7 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class FrameBattleship extends JFrame {
|
public class FrameBattleship extends JFrame {
|
||||||
private DrawingBattleship drawingBattleship;
|
private DrawingBattleship drawingBattleship;
|
||||||
private JComponent pictureBox;
|
private JComponent pictureBox;
|
Loading…
Reference in New Issue
Block a user