1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 20:10:27 +01:00

Add tests to repository

This commit is contained in:
Jan Larres
2013-03-28 00:16:03 +13:00
parent b6f47e4020
commit db9404ca1a
128 changed files with 54624 additions and 0 deletions

40
tests/java/ShipSquare.java Executable file
View File

@@ -0,0 +1,40 @@
import javax.swing.ImageIcon;
/**
* A Ship square represents a square that contains a battle ship, but has not
* yet been bombed. Ship Squares can be either visible or invisible (depending
* on which side they are).
*
* @author djp
*/
public class ShipSquare extends GridSquare {
private BattleShip ship;
private Type type;
public enum Type {
VERTICAL_TOP_END,
HORIZONTAL_MIDDLE
};
/**
* Construct a ShipSquare representing part of a battle ship (either a
* middle or end piece).
*
*/
public ShipSquare(Type type, BattleShip ship) {
this.type = type;
this.ship = ship;
}
/**
* Get the ship that this square is part of.
* @return
*/
public BattleShip getShip() { return ship; }
/**
* Determine what part of the ship this piece represents.
* @return
*/
public Type getType() { return type; }
}