Ändra från egotripp till egodipp
8
pom.xml
@ -4,7 +4,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.billenius</groupId>
|
<groupId>com.limone</groupId>
|
||||||
<artifactId>Schack</artifactId>
|
<artifactId>Schack</artifactId>
|
||||||
<version>1</version>
|
<version>1</version>
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/java/</directory>
|
<directory>src/main/java/</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>com/billenius/img/</include>
|
<include>com/limone/img/</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
@ -97,7 +97,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>com.billenius.schack.Schack</mainClass>
|
<mainClass>com.limone.schack.Schack</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptorRefs>
|
||||||
@ -114,7 +114,7 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<addClasspath>true</addClasspath>
|
<addClasspath>true</addClasspath>
|
||||||
<mainClass>com.billenius.schack.Schack</mainClass>
|
<mainClass>com.limone.schack.Schack</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack;
|
package com.limone.schack;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
@ -1,8 +1,8 @@
|
|||||||
package com.billenius.schack;
|
package com.limone.schack;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
|
|
||||||
import com.billenius.schack.pieces.Piece;
|
import com.limone.schack.pieces.Piece;
|
||||||
|
|
||||||
public class Move extends BasicMove {
|
public class Move extends BasicMove {
|
||||||
public Piece movedPiece;
|
public Piece movedPiece;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack;
|
package com.limone.schack;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
@ -1,167 +1,167 @@
|
|||||||
package com.billenius.schack;
|
package com.limone.schack;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.HeadlessException;
|
import java.awt.HeadlessException;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.swing.DefaultListModel;
|
import javax.swing.DefaultListModel;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
import javax.swing.JMenuItem;
|
import javax.swing.JMenuItem;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JSplitPane;
|
import javax.swing.JSplitPane;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
|
|
||||||
import com.billenius.schack.boards.Board;
|
import com.formdev.flatlaf.FlatLightLaf;
|
||||||
import com.billenius.schack.boards.NetworkBoard;
|
import com.limone.schack.boards.Board;
|
||||||
import com.billenius.schack.boards.SameBoard;
|
import com.limone.schack.boards.NetworkBoard;
|
||||||
import com.formdev.flatlaf.FlatLightLaf;
|
import com.limone.schack.boards.SameBoard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Love Billenius & Simon Hansson
|
* @author Love Billenius & Simon Hansson
|
||||||
*/
|
*/
|
||||||
public class Schack {
|
public class Schack {
|
||||||
|
|
||||||
final JFrame frame;
|
final JFrame frame;
|
||||||
// Förlåt mig fader för jag kommer synda
|
// Förlåt mig fader för jag kommer synda
|
||||||
public final static Map<String, BufferedImage> pieceIcons = new HashMap<>();
|
public final static Map<String, BufferedImage> pieceIcons = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Schack() throws IOException {
|
public Schack() throws IOException {
|
||||||
// Set theme
|
// Set theme
|
||||||
try {
|
try {
|
||||||
if (UIManager.getSystemLookAndFeelClassName()
|
if (UIManager.getSystemLookAndFeelClassName()
|
||||||
.equals("javax.swing.plaf.metal.MetalLookAndFeel"))
|
.equals("javax.swing.plaf.metal.MetalLookAndFeel"))
|
||||||
UIManager.setLookAndFeel(new FlatLightLaf());
|
UIManager.setLookAndFeel(new FlatLightLaf());
|
||||||
else
|
else
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (Exception cantGetSystemTheme) {
|
} catch (Exception cantGetSystemTheme) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] options = { "On the same screen", "Over the internet" };
|
String[] options = { "On the same screen", "Over the internet" };
|
||||||
int choosenTransformations = JOptionPane.showOptionDialog(null,
|
int choosenTransformations = JOptionPane.showOptionDialog(null,
|
||||||
"How do you want to connect with your opponent",
|
"How do you want to connect with your opponent",
|
||||||
"Schack: Selection",
|
"Schack: Selection",
|
||||||
JOptionPane.DEFAULT_OPTION,
|
JOptionPane.DEFAULT_OPTION,
|
||||||
JOptionPane.INFORMATION_MESSAGE,
|
JOptionPane.INFORMATION_MESSAGE,
|
||||||
null,
|
null,
|
||||||
options,
|
options,
|
||||||
options[0]);
|
options[0]);
|
||||||
|
|
||||||
DefaultListModel<Move> listModel = new DefaultListModel<>();
|
DefaultListModel<Move> listModel = new DefaultListModel<>();
|
||||||
final Board board;
|
final Board board;
|
||||||
if (choosenTransformations == 0)
|
if (choosenTransformations == 0)
|
||||||
board = new SameBoard(listModel);
|
board = new SameBoard(listModel);
|
||||||
else
|
else
|
||||||
board = new NetworkBoard(listModel);
|
board = new NetworkBoard(listModel);
|
||||||
|
|
||||||
frame = new JFrame();
|
frame = new JFrame();
|
||||||
frame.setTitle("Schack");
|
frame.setTitle("Schack");
|
||||||
frame.setAlwaysOnTop(false);
|
frame.setAlwaysOnTop(false);
|
||||||
frame.setResizable(true);
|
frame.setResizable(true);
|
||||||
|
|
||||||
// Might throw an IOException if the icon of the Pieces isn't embedded correctly
|
// Might throw an IOException if the icon of the Pieces isn't embedded correctly
|
||||||
// final Board board = new BlistModeloard(listModel);
|
// final Board board = new BlistModeloard(listModel);
|
||||||
|
|
||||||
// Logger
|
// Logger
|
||||||
final JList<Move> jlist = new JList<>(listModel);
|
final JList<Move> jlist = new JList<>(listModel);
|
||||||
jlist.setVisible(true);
|
jlist.setVisible(true);
|
||||||
jlist.setCellRenderer(new PieceRenderer());
|
jlist.setCellRenderer(new PieceRenderer());
|
||||||
JScrollPane scrollPane = new JScrollPane(jlist);
|
JScrollPane scrollPane = new JScrollPane(jlist);
|
||||||
// scrollPane.setPreferredSize(new Dimension(120, 700));
|
// scrollPane.setPreferredSize(new Dimension(120, 700));
|
||||||
JPanel logPanel = new JPanel(new BorderLayout());
|
JPanel logPanel = new JPanel(new BorderLayout());
|
||||||
logPanel.setPreferredSize(new Dimension(120, 800));
|
logPanel.setPreferredSize(new Dimension(120, 800));
|
||||||
|
|
||||||
JLabel infoText = new JLabel("Moves");
|
JLabel infoText = new JLabel("Moves");
|
||||||
infoText.setFont(new Font("Cantarell", Font.PLAIN, 18));
|
infoText.setFont(new Font("Cantarell", Font.PLAIN, 18));
|
||||||
|
|
||||||
infoText.setHorizontalAlignment(JLabel.CENTER);
|
infoText.setHorizontalAlignment(JLabel.CENTER);
|
||||||
logPanel.add(infoText, BorderLayout.NORTH);
|
logPanel.add(infoText, BorderLayout.NORTH);
|
||||||
logPanel.add(scrollPane, BorderLayout.CENTER);
|
logPanel.add(scrollPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
|
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
|
||||||
splitPane.setDividerLocation(800);
|
splitPane.setDividerLocation(800);
|
||||||
splitPane.setLeftComponent(board);
|
splitPane.setLeftComponent(board);
|
||||||
splitPane.setRightComponent(logPanel);
|
splitPane.setRightComponent(logPanel);
|
||||||
|
|
||||||
frame.setContentPane(splitPane);
|
frame.setContentPane(splitPane);
|
||||||
frame.getContentPane().addMouseListener(board);
|
frame.getContentPane().addMouseListener(board);
|
||||||
|
|
||||||
// Create menu
|
// Create menu
|
||||||
final JMenuBar menuBar = new JMenuBar();
|
final JMenuBar menuBar = new JMenuBar();
|
||||||
final JMenu gameMenu = new JMenu("Game");
|
final JMenu gameMenu = new JMenu("Game");
|
||||||
final JMenu connectMenu = new JMenu("Connect");
|
final JMenu connectMenu = new JMenu("Connect");
|
||||||
final JMenuItem askForRemi = new JMenuItem("Ask for remi");
|
final JMenuItem askForRemi = new JMenuItem("Ask for remi");
|
||||||
final JMenuItem surrender = new JMenuItem("Surrender");
|
final JMenuItem surrender = new JMenuItem("Surrender");
|
||||||
final JMenuItem showIP = new JMenuItem("Show IP");
|
final JMenuItem showIP = new JMenuItem("Show IP");
|
||||||
final JMenuItem connectToOpponent = new JMenuItem("Connect to opponent");
|
final JMenuItem connectToOpponent = new JMenuItem("Connect to opponent");
|
||||||
|
|
||||||
askForRemi.addActionListener((ActionEvent ae) -> {
|
askForRemi.addActionListener((ActionEvent ae) -> {
|
||||||
String whosWantingRemi = board.isWhitesTurn() ? "Vit" : "Svart";
|
String whosWantingRemi = board.isWhitesTurn() ? "Vit" : "Svart";
|
||||||
int choice = JOptionPane.showConfirmDialog(board, whosWantingRemi + " erbjuder remi\nAccepterar du?");
|
int choice = JOptionPane.showConfirmDialog(board, whosWantingRemi + " erbjuder remi\nAccepterar du?");
|
||||||
if (choice == JOptionPane.YES_OPTION) {
|
if (choice == JOptionPane.YES_OPTION) {
|
||||||
choice = JOptionPane.showConfirmDialog(board, "Lika\nStarta om?");
|
choice = JOptionPane.showConfirmDialog(board, "Lika\nStarta om?");
|
||||||
if (choice == JOptionPane.YES_OPTION) {
|
if (choice == JOptionPane.YES_OPTION) {
|
||||||
try {
|
try {
|
||||||
board.restartGame();
|
board.restartGame();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
surrender.addActionListener((ActionEvent ae) -> {
|
surrender.addActionListener((ActionEvent ae) -> {
|
||||||
String whosGivingUp = board.isWhitesTurn() ? "Vit" : "Svart";
|
String whosGivingUp = board.isWhitesTurn() ? "Vit" : "Svart";
|
||||||
int choice = JOptionPane.showConfirmDialog(board, whosGivingUp + " har gett upp\nStarta om?");
|
int choice = JOptionPane.showConfirmDialog(board, whosGivingUp + " har gett upp\nStarta om?");
|
||||||
if (choice == JOptionPane.YES_OPTION) {
|
if (choice == JOptionPane.YES_OPTION) {
|
||||||
try {
|
try {
|
||||||
board.restartGame();
|
board.restartGame();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
showIP.addActionListener((ActionEvent ae) -> {
|
showIP.addActionListener((ActionEvent ae) -> {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String ip = Inet4Address.getLocalHost().toString();
|
String ip = Inet4Address.getLocalHost().toString();
|
||||||
JOptionPane.showMessageDialog(null, "IP: " + ip);
|
JOptionPane.showMessageDialog(null, "IP: " + ip);
|
||||||
|
|
||||||
} catch (HeadlessException | UnknownHostException e) {
|
} catch (HeadlessException | UnknownHostException e) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connectToOpponent.addActionListener((ActionEvent ae) -> {
|
connectToOpponent.addActionListener((ActionEvent ae) -> {
|
||||||
String opponentIP = JOptionPane.showInputDialog(null, "What's your opponents IP?");
|
String opponentIP = JOptionPane.showInputDialog(null, "What's your opponents IP?");
|
||||||
System.out.println("opponents ip: " + opponentIP);
|
System.out.println("opponents ip: " + opponentIP);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add the menu stuff
|
// Add the menu stuff
|
||||||
frame.setJMenuBar(menuBar);
|
frame.setJMenuBar(menuBar);
|
||||||
menuBar.add(gameMenu);
|
menuBar.add(gameMenu);
|
||||||
menuBar.add(connectMenu);
|
menuBar.add(connectMenu);
|
||||||
gameMenu.add(askForRemi);
|
gameMenu.add(askForRemi);
|
||||||
gameMenu.add(surrender);
|
gameMenu.add(surrender);
|
||||||
connectMenu.add(showIP);
|
connectMenu.add(showIP);
|
||||||
connectMenu.add(connectToOpponent);
|
connectMenu.add(connectToOpponent);
|
||||||
frame.pack();
|
frame.pack();
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
new Schack();
|
new Schack();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack;
|
package com.limone.schack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.boards;
|
package com.limone.schack.boards;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@ -14,15 +14,15 @@ import java.util.List;
|
|||||||
import javax.swing.DefaultListModel;
|
import javax.swing.DefaultListModel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import com.billenius.schack.Move;
|
import com.limone.schack.Move;
|
||||||
import com.billenius.schack.SchackState;
|
import com.limone.schack.SchackState;
|
||||||
import com.billenius.schack.pieces.Bishop;
|
import com.limone.schack.pieces.Bishop;
|
||||||
import com.billenius.schack.pieces.Horse;
|
import com.limone.schack.pieces.Horse;
|
||||||
import com.billenius.schack.pieces.King;
|
import com.limone.schack.pieces.King;
|
||||||
import com.billenius.schack.pieces.Pawn;
|
import com.limone.schack.pieces.Pawn;
|
||||||
import com.billenius.schack.pieces.Piece;
|
import com.limone.schack.pieces.Piece;
|
||||||
import com.billenius.schack.pieces.Queen;
|
import com.limone.schack.pieces.Queen;
|
||||||
import com.billenius.schack.pieces.Rook;
|
import com.limone.schack.pieces.Rook;
|
||||||
|
|
||||||
public abstract class Board extends JPanel implements MouseListener {
|
public abstract class Board extends JPanel implements MouseListener {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.boards;
|
package com.limone.schack.boards;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@ -18,10 +18,10 @@ import javax.swing.JLabel;
|
|||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import com.billenius.schack.BasicMove;
|
import com.limone.schack.BasicMove;
|
||||||
import com.billenius.schack.Move;
|
import com.limone.schack.Move;
|
||||||
import com.billenius.schack.SchackState;
|
import com.limone.schack.SchackState;
|
||||||
import com.billenius.schack.pieces.Piece;
|
import com.limone.schack.pieces.Piece;
|
||||||
|
|
||||||
public final class NetworkBoard extends Board implements Runnable {
|
public final class NetworkBoard extends Board implements Runnable {
|
||||||
public final static int PORT = 1339;
|
public final static int PORT = 1339;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.boards;
|
package com.limone.schack.boards;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -6,9 +6,9 @@ import java.util.ArrayList;
|
|||||||
import javax.swing.DefaultListModel;
|
import javax.swing.DefaultListModel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
import com.billenius.schack.Move;
|
import com.limone.schack.Move;
|
||||||
import com.billenius.schack.SchackState;
|
import com.limone.schack.SchackState;
|
||||||
import com.billenius.schack.pieces.Piece;
|
import com.limone.schack.pieces.Piece;
|
||||||
|
|
||||||
public final class SameBoard extends Board {
|
public final class SameBoard extends Board {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.HeadlessException;
|
import java.awt.HeadlessException;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
@ -9,7 +9,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
import com.billenius.schack.boards.Board;
|
import com.limone.schack.boards.Board;
|
||||||
|
|
||||||
public abstract class Piece {
|
public abstract class Piece {
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public abstract class Piece {
|
|||||||
|
|
||||||
private BufferedImage getPieceIcon() throws IOException {
|
private BufferedImage getPieceIcon() throws IOException {
|
||||||
String colorName = isWhite() ? "White" : "Black";
|
String colorName = isWhite() ? "White" : "Black";
|
||||||
String path = "/com/billenius/img/" + colorName + getClass().getSimpleName() + ".png";
|
String path = "/com/limone/img/" + colorName + getClass().getSimpleName() + ".png";
|
||||||
InputStream inputStream = getClass().getResourceAsStream(path);
|
InputStream inputStream = getClass().getResourceAsStream(path);
|
||||||
return ImageIO.read(inputStream);
|
return ImageIO.read(inputStream);
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
@ -1,4 +1,4 @@
|
|||||||
package com.billenius.schack.pieces;
|
package com.limone.schack.pieces;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|