Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short Truth Table Puzzle Editor #451

Merged
merged 107 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
5b31506
Created files for STT elements
charlestian23 Feb 13, 2023
7dd7ee6
Merge pull request #450 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Feb 13, 2023
ec486d6
Renamed Tiles classes to Elements to match package name
charlestian23 Feb 13, 2023
9cd8255
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Feb 13, 2023
14122c1
More progress made
charlestian23 Feb 13, 2023
cfe8206
More progress being made
charlestian23 Feb 13, 2023
4c680dd
Fixed file name typo and added placeholder tiles
charlestian23 Feb 14, 2023
dd5fd8b
Added image paths
charlestian23 Feb 14, 2023
9a7b275
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Feb 14, 2023
c206a5d
Created element classes and added placeholder tile images (#452)
charlestian23 Feb 14, 2023
8a5e4f9
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Feb 17, 2023
44e3dc8
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Feb 24, 2023
bdcdc27
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Feb 24, 2023
bbaa153
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Mar 9, 2023
a32904d
Set the current board on boardView
charlestian23 Mar 9, 2023
0266d7f
Fixed typo and turned on STT puzzle editor for testing
charlestian23 Mar 9, 2023
dd882c8
Added preliminary valid dimensions checker
charlestian23 Mar 9, 2023
198cbcc
Fixed image file paths
charlestian23 Mar 9, 2023
daa5444
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Mar 9, 2023
00e52c0
Merge pull request #494 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Mar 9, 2023
9f8cb96
Added ActionListener
charlestian23 Mar 17, 2023
eceb9c8
Merge branch 'puzzle_editor-short_truth_table' of https://github.com/…
charlestian23 Mar 17, 2023
51e6d95
Hide rows and columns input for Short Truth Table
charlestian23 Mar 17, 2023
23566ac
Added text area for Short Truth Table
charlestian23 Mar 17, 2023
007a569
Added scrollbars to show up as needed
charlestian23 Mar 17, 2023
c01771e
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Mar 17, 2023
28c424f
Reformatted code
charlestian23 Mar 17, 2023
f61045a
Merge branch 'puzzle_editor-short_truth_table' of https://github.com/…
charlestian23 Mar 17, 2023
1866116
More code reformatting
charlestian23 Mar 17, 2023
3b8797e
Even more reformatting
charlestian23 Mar 17, 2023
56dfccc
Merge pull request #495 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Mar 17, 2023
c1a3fc5
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Mar 17, 2023
dc07f03
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Mar 17, 2023
8addfb1
Separate the data from the TextArea into different lines
charlestian23 Mar 20, 2023
7b2d2f7
Did some researching/testing
charlestian23 Mar 20, 2023
69e4562
Made more progress
charlestian23 Mar 21, 2023
563d928
Added a bunch of TODOs
charlestian23 Mar 21, 2023
da92e36
Made some more progress
charlestian23 Mar 24, 2023
93b13f4
Implemented abstract methods from PuzzleImporter
charlestian23 Mar 29, 2023
3776239
Merge branch 'Bram-Hub:puzzle_editor-short_truth_table' into puzzle_e…
charlestian23 Mar 29, 2023
0f32257
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Mar 29, 2023
111e0e9
Merge branch 'Bram-Hub:puzzle_editor-short_truth_table' into puzzle_e…
charlestian23 Mar 29, 2023
20204a2
Added abstract methods to Fillapix and added other exception reporting
charlestian23 Mar 29, 2023
5d05a81
CheckStyle formatting
charlestian23 Mar 29, 2023
46c77b7
Removed a TODO comment
charlestian23 Mar 31, 2023
09fc3a3
Statements show up in puzzle editor
charlestian23 Mar 31, 2023
091451c
Removed empty statements
charlestian23 Mar 31, 2023
81b588b
Merge pull request #512 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Mar 31, 2023
48f34ba
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Mar 31, 2023
df5db8d
Changed InvalidFormatException to IllegalArgumentException
charlestian23 Mar 31, 2023
38f3c0c
Remove argument that has already been caught
charlestian23 Mar 31, 2023
2c26e90
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Mar 31, 2023
57ca5e3
Merge pull request #514 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Mar 31, 2023
9522814
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Mar 31, 2023
5ad5fc7
Removed elements that will not be used
charlestian23 Apr 4, 2023
d59fe45
Added puzzle editor cell clicking functionality
charlestian23 Apr 4, 2023
93d2876
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 7, 2023
f3d7427
Added ability to toggle certain logical elements
charlestian23 Apr 7, 2023
345998c
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Apr 7, 2023
6d2a19d
Merge pull request #522 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Apr 7, 2023
2e24c0e
New icons and more functionality implemented
charlestian23 Apr 7, 2023
33c5056
Merge branch 'puzzle_editor-short_truth_table' of https://github.com/…
charlestian23 Apr 7, 2023
c1616cf
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 7, 2023
817da3b
Fixed a bug where spacer rows could be modified
charlestian23 Apr 11, 2023
0b938be
Added statement error checking
charlestian23 Apr 11, 2023
ade3819
Fixed formatting
charlestian23 Apr 11, 2023
a8b4df5
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Apr 11, 2023
a4406d6
Merge pull request #534 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Apr 11, 2023
08a8ba7
Only one logic symbol element needed
charlestian23 Apr 11, 2023
d688599
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Apr 11, 2023
22de5d3
Merge pull request #537 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Apr 11, 2023
3e7e457
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 14, 2023
b57544f
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 18, 2023
f47ad8e
Changed InputMismatchException to UnsupportedOperationException
charlestian23 Apr 18, 2023
6ca023b
Renamed variables to not be STT specific
charlestian23 Apr 21, 2023
882bc57
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 21, 2023
32c37b5
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Apr 21, 2023
8507c85
Merge pull request #543 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Apr 21, 2023
20e565c
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 25, 2023
beb60a2
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Apr 26, 2023
8dfa6ef
Finding initial issue and starting fix
MMosley502 Apr 28, 2023
12ee63b
Issue is statement copying and modifying
MMosley502 Apr 28, 2023
8d44486
STT exporter now working. Overrode setCell for STTBoard.
MMosley502 Apr 28, 2023
25d2585
Added code documentation
MMosley502 Apr 28, 2023
52344ea
removed testing println()
MMosley502 Apr 28, 2023
1d1a562
Gradle fixes
MMosley502 Apr 28, 2023
2e82547
Merge pull request #545 from MMosley502/puzzle_editor-short_truth_tab…
MMosley502 Apr 28, 2023
0285505
Revert "Merge pull request #545 from MMosley502/puzzle_editor-short_t…
charlestian23 Apr 28, 2023
2e05069
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Jun 12, 2023
f994a07
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Aug 30, 2023
2daca5c
Saving files now works
charlestian23 Sep 26, 2023
0cb069b
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Sep 26, 2023
17e1581
Merge pull request #619 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Sep 26, 2023
de7b570
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Sep 26, 2023
866fc8c
Fixed the blank element to be categorized as a placeable element
charlestian23 Sep 29, 2023
299188e
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Sep 29, 2023
de9f1c5
Merge pull request #620 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Sep 29, 2023
a52b931
Fixed a bug where file wouldn't save due to batch grader updates
charlestian23 Sep 29, 2023
8ffad4f
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Sep 29, 2023
3530840
Merge pull request #621 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Sep 29, 2023
81f5781
Merge branch 'dev' into puzzle_editor-short_truth_table
charlestian23 Sep 29, 2023
d40bb5a
Reformatted code in STT
charlestian23 Sep 29, 2023
f2c181c
Merge branch 'puzzle_editor-short_truth_table' of https://github.com/…
charlestian23 Sep 29, 2023
c0e4845
Merge branch 'puzzle_editor-short_truth_table' into puzzle_editor-sho…
charlestian23 Sep 29, 2023
2016f0a
Merge pull request #622 from charlestian23/puzzle_editor-short_truth_…
charlestian23 Sep 29, 2023
53358b5
Reformatted code again
charlestian23 Sep 29, 2023
7cd52bd
MORE REFORMATTING
charlestian23 Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/main/edu/rpi/legup/legup/config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<puzzle name="ShortTruthTable"
qualifiedClassName="edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable"
fileType=".xml"
fileCreationDisabled="true"/>
fileCreationDisabled="false"/>
<puzzle name="Sudoku" qualifiedClassName="edu.rpi.legup.puzzle.sudoku.Sudoku"
fileType=".xml"
fileCreationDisabled="true"/>
Expand Down
14 changes: 14 additions & 0 deletions puzzles files/shorttruthtable/empty_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Legup version="2.0.0">
<puzzle name="ShortTruthTable">
<board>
<data>
<statement representation="A>(B^C)" row_index="0"/>
<statement representation="C-B" row_index="1"/>
<statement representation="~C" row_index="2"/>
<statement representation="~A" row_index="3"/>
</data>
</board>
</puzzle>
<Solved isSolved="false"/>
</Legup>
84 changes: 76 additions & 8 deletions src/main/java/edu/rpi/legup/app/GameBoardFacade.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package edu.rpi.legup.app;

import edu.rpi.legup.history.History;
import edu.rpi.legup.history.IHistoryListener;
import edu.rpi.legup.history.IHistorySubject;
import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.PuzzleImporter;
import edu.rpi.legup.model.gameboard.Board;
import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.tree.Tree;
import edu.rpi.legup.save.InvalidFileFormatException;
import edu.rpi.legup.ui.LegupUI;
import edu.rpi.legup.ui.ProofEditorPanel;
import edu.rpi.legup.ui.PuzzleEditorPanel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import edu.rpi.legup.save.InvalidFileFormatException;
import edu.rpi.legup.ui.LegupUI;
import edu.rpi.legup.history.History;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
Expand Down Expand Up @@ -144,6 +143,30 @@ public boolean validateDimensions(String game, int rows, int columns) throws Run
}
}

/**
* Validates the given text input for the given puzzle
*
* @param game the name of the puzzle
* @param statements an array of statements
* @return true if it is possible to create a board for the given game with the given statements,
* false otherwise
* @throws RuntimeException if any of the input is invalid
*/
public boolean validateTextInput(String game, String[] statements) throws RuntimeException {
String qualifiedClassName = config.getPuzzleClassForName(game);
try {
Class<?> c = Class.forName(qualifiedClassName);
Constructor<?> constructor = c.getConstructor();
Puzzle puzzle = (Puzzle) constructor.newInstance();
return puzzle.isValidTextInput(statements);
}
catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException |
InstantiationException e) {
LOGGER.error(e);
throw new RuntimeException("Error validating puzzle text input");
}
}

/**
* Loads an empty puzzle
*
Expand All @@ -159,14 +182,20 @@ public void loadPuzzle(String game, int rows, int columns) throws RuntimeExcepti
Class<?> c = Class.forName(qualifiedClassName);
Constructor<?> cons = c.getConstructor();
Puzzle puzzle = (Puzzle) cons.newInstance();
setWindowTitle(puzzle.getName(), "New " + puzzle.getName() + " Puzzle");

PuzzleImporter importer = puzzle.getImporter();
if (importer == null) {
LOGGER.error("Puzzle importer is null");
throw new RuntimeException("Puzzle importer null");
}

// Theoretically, this exception should never be thrown, since LEGUP should not be
// allowing the user to give row/column input for a puzzle that doesn't support it
if (!importer.acceptsRowsAndColumnsInput()) {
throw new IllegalArgumentException(puzzle.getName() + " does not accept rows and columns input");
}

setWindowTitle(puzzle.getName(), "New " + puzzle.getName() + " Puzzle");
importer.initializePuzzle(rows, columns);

puzzle.initializeView();
Expand All @@ -183,6 +212,45 @@ public void loadPuzzle(String game, int rows, int columns) throws RuntimeExcepti
}
}

public void loadPuzzle(String game, String[] statements) {
String qualifiedClassName = config.getPuzzleClassForName(game);
LOGGER.debug("Loading " + qualifiedClassName);

try {
Class<?> c = Class.forName(qualifiedClassName);
Constructor<?> cons = c.getConstructor();
Puzzle puzzle = (Puzzle) cons.newInstance();

PuzzleImporter importer = puzzle.getImporter();
if (importer == null) {
LOGGER.error("Puzzle importer is null");
throw new RuntimeException("Puzzle importer null");
}

// Theoretically, this exception should never be thrown, since LEGUP should not be
// allowing the user to give text input for a puzzle that doesn't support it
if (!importer.acceptsTextInput()) {
throw new IllegalArgumentException(puzzle.getName() + " does not accept text input");
}

setWindowTitle(puzzle.getName(), "New " + puzzle.getName() + " Puzzle");
importer.initializePuzzle(statements);

puzzle.initializeView();
// puzzle.getBoardView().onTreeElementChanged(puzzle.getTree().getRootNode());
setPuzzleEditor(puzzle);
}
catch (IllegalArgumentException exception) {
throw new IllegalArgumentException(exception.getMessage());
}
catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
IllegalAccessException | InstantiationException e) {
LOGGER.error(e);
throw new RuntimeException("Puzzle creation error");
}

}

/**
* Loads a puzzle file
*
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/edu/rpi/legup/model/Puzzle.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,26 @@ public boolean isValidDimensions(int rows, int columns) {
return rows > 0 && columns > 0;
}

/**
* Checks if the given array of statements is valid text input for the given puzzle
*
* @param statements
* @return
*/
public boolean isValidTextInput(String[] statements) {
return statements.length > 0;
}

/**
* Determines if the edu.rpi.legup.puzzle was solves correctly
*
* @return true if the board was solved correctly, false otherwise
*/
public boolean isPuzzleComplete() {
if (tree == null) {
return false;
}

boolean isComplete = tree.isValid();
if (isComplete) {
for (TreeElement leaf : tree.getLeafTreeElements()) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/edu/rpi/legup/model/PuzzleExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public abstract class PuzzleExporter {

/**
* PuzzleExporter Constructor exports the puzzle object to a file
*
* @param puzzle puzzle that is to be exported
*/
public PuzzleExporter(Puzzle puzzle) {
Expand Down
19 changes: 15 additions & 4 deletions src/main/java/edu/rpi/legup/model/PuzzleImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;

public abstract class PuzzleImporter {
private static final Logger LOGGER = LogManager.getLogger(PuzzleImporter.class.getName());
Expand All @@ -24,12 +21,17 @@ public abstract class PuzzleImporter {

/**
* PuzzleImporter Constructor creates the puzzle object
*
* @param puzzle puzzle that is imported
*/
public PuzzleImporter(Puzzle puzzle) {
this.puzzle = puzzle;
}

public abstract boolean acceptsRowsAndColumnsInput();

public abstract boolean acceptsTextInput();

/**
* Initializes an empty puzzle
*
Expand All @@ -46,6 +48,13 @@ public void initializePuzzle(int rows, int columns) throws RuntimeException {
}
}

public void initializePuzzle(String[] statements) throws InputMismatchException, IllegalArgumentException {
// Note: Error checking for the statements will be left up to the puzzles that support
// text input. For example, some puzzles may be okay with "blank" statements (Strings with
// length = 0) while others may not.
initializeBoard(statements);
}

/**
* Initializes the puzzle attributes
*
Expand Down Expand Up @@ -116,6 +125,8 @@ public void initializePuzzle(Node node) throws InvalidFileFormatException {
*/
public abstract void initializeBoard(Node node) throws InvalidFileFormatException;

public abstract void initializeBoard(String[] statements) throws UnsupportedOperationException, IllegalArgumentException;

/**
* Creates the proof for building
*
Expand Down
1 change: 1 addition & 0 deletions src/main/java/edu/rpi/legup/model/tree/Tree.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public Set<TreeElement> getLeafTreeElements() {

/**
* Gets a Set of TreeNodes that are leaf nodes from the sub tree rooted at the specified node
*
* @param node node that is input
* @return Set of TreeNodes that are leaf nodes from the sub tree
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ public BattleshipImporter(Battleship battleShip) {
super(battleShip);
}

@Override
public boolean acceptsRowsAndColumnsInput() {
return true;
}

@Override
public boolean acceptsTextInput() {
return false;
}

/**
* Creates an empty board for building
*
Expand Down Expand Up @@ -177,4 +187,9 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
"unknown value where integer expected");
}
}

@Override
public void initializeBoard(String[] statements) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Battleship cannot accept text input");
}
}
15 changes: 15 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/fillapix/FillapixImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ public FillapixImporter(Fillapix fillapix) {
super(fillapix);
}

@Override
public boolean acceptsRowsAndColumnsInput() {
return true;
}

@Override
public boolean acceptsTextInput() {
return false;
}

/**
* Creates an empty board for building
*
Expand Down Expand Up @@ -88,4 +98,9 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
throw new InvalidFileFormatException("Fillapix Importer: unknown value where integer expected");
}
}

@Override
public void initializeBoard(String[] statements) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Fillapix cannot accept text input");
}
}
15 changes: 15 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/heyawake/HeyawakeImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ public HeyawakeImporter(Heyawake heyawake) {
super(heyawake);
}

@Override
public boolean acceptsRowsAndColumnsInput() {
return true;
}

@Override
public boolean acceptsTextInput() {
return false;
}

/**
* Creates an empty board for building
*
Expand Down Expand Up @@ -91,4 +101,9 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
throw new InvalidFileFormatException("Heyawake Importer: unknown value where integer expected");
}
}

@Override
public void initializeBoard(String[] statements) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Hey Awake cannot accept text input");
}
}
15 changes: 15 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/lightup/LightUpImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ public LightUpImporter(LightUp lightUp) {
super(lightUp);
}

@Override
public boolean acceptsRowsAndColumnsInput() {
return true;
}

@Override
public boolean acceptsTextInput() {
return false;
}

/**
* Creates an empty board for building
*
Expand Down Expand Up @@ -102,4 +112,9 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
throw new InvalidFileFormatException("lightup Importer: unknown value where integer expected");
}
}

@Override
public void initializeBoard(String[] statements) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Light Up cannot accept text input");
}
}
15 changes: 15 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/masyu/MasyuImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ public MasyuImporter(Masyu masyu) {
super(masyu);
}

@Override
public boolean acceptsRowsAndColumnsInput() {
return true;
}

@Override
public boolean acceptsTextInput() {
return false;
}

/**
* Creates an empty board for building
*
Expand Down Expand Up @@ -90,4 +100,9 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
throw new InvalidFileFormatException("Masyu Importer: unknown value where integer expected");
}
}

@Override
public void initializeBoard(String[] statements) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Masyu cannot accept text input");
}
}
Loading
Loading