Skip to content

Commit

Permalink
Merge pull request #35 from UnGuZartex/Tests
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
UnGuZartex authored Mar 15, 2020
2 parents bb5183b + 78a0e9d commit 41f70eb
Show file tree
Hide file tree
Showing 26 changed files with 1,480 additions and 91 deletions.
7 changes: 5 additions & 2 deletions src/main/java/GUI/Blocks/Factories/GUIFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ public abstract class GUIFactory {
/**
* Abstract method a GUIBlockFactory needs to implement to create a new GUIBlock.
*
* @return a new GUIBlock
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return a new GUIBlock with given id and coordinates.
*/
// TODO params
public abstract GUIBlock createBlock(String id, int x, int y);
}

25 changes: 21 additions & 4 deletions src/main/java/GUI/Blocks/Factories/IfGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUICavityBlock;

/**
* A factory to create if GUI blocks.
*
* @author Alpha-team
*/
public class IfGUIFactory extends GUIFactory {
private String name = "If";

/**
* Variable referring to the name of an if block.
*/
private static final String name = "If";

/**
* Create a new if block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new cavity block block with given id and coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
return new GUICavityBlock(name, id, x,y);
public GUICavityBlock createBlock(String id, int x, int y) {
return new GUICavityBlock(name, id, x, y);
}
}
24 changes: 21 additions & 3 deletions src/main/java/GUI/Blocks/Factories/MoveForwardGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUIFunctionalityBlock;

/**
* A factory to create move forward GUI blocks.
*
* @author Alpha-team
*/
public class MoveForwardGUIFactory extends GUIFactory{
private String name = "Move Forward";

/**
* Variable referring to the name of a move forward block.
*/
private static final String name = "Move Forward";


/**
* Create a new move forward block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new functional block with given id and coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
public GUIFunctionalityBlock createBlock(String id, int x, int y) {
return new GUIFunctionalityBlock(name, id, x,y);
}
}
23 changes: 20 additions & 3 deletions src/main/java/GUI/Blocks/Factories/NotGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUIOperatorBlock;

/**
* A factory to create new not GUI blocks.
*
* @author Alpha-team
*/
public class NotGUIFactory extends GUIFactory {
private String name = "Not";

/**
* Variable referring to the name of a not block.
*/
private static final String name = "Not";

/**
* Create a new not block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new operator block with given id and coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
public GUIOperatorBlock createBlock(String id, int x, int y) {
return new GUIOperatorBlock(name, id, x,y);
}
}
22 changes: 19 additions & 3 deletions src/main/java/GUI/Blocks/Factories/TurnLeftGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUIFunctionalityBlock;

/**
* A factory to create turn left GUI blocks.
*
* @author Alpha-team
*/
public class TurnLeftGUIFactory extends GUIFactory {
private String name = "Turn Left";

/**
* Variable referring to the name of an turn left block.
*/
private static final String name = "Turn Left";

/**
* Create a new turn left block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new functional block with given id and coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
public GUIFunctionalityBlock createBlock(String id, int x, int y) {
return new GUIFunctionalityBlock(name, id, x, y);
}
}
22 changes: 19 additions & 3 deletions src/main/java/GUI/Blocks/Factories/TurnRightGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUIFunctionalityBlock;

/**
* Factory to create new turn right GUI block.
*
* @author Alpha-team
*/
public class TurnRightGUIFactory extends GUIFactory{
private String name = "Turn Right";

/**
* Variable referring to the name of a turn right block.
*/
private static final String name = "Turn Right";

/**
* Create a new turn right block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new functional block with given id and coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
public GUIFunctionalityBlock createBlock(String id, int x, int y) {
return new GUIFunctionalityBlock(name, id, x,y);
}
}
23 changes: 20 additions & 3 deletions src/main/java/GUI/Blocks/Factories/WallInFrontGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUIConditionalBlock;

/**
* Factory to create wall in front gui blocks.
*
* @author Alpha-team
*/
public class WallInFrontGUIFactory extends GUIFactory{
private String name = "Wall In Front";

/**
* Variable referring to the name of an wall in front block.
*/
private static final String name = "Wall In Front";

/**
* Create a new wall in front block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new conditional block with given coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
public GUIConditionalBlock createBlock(String id, int x, int y) {
return new GUIConditionalBlock(name, id, x,y);
}
}
23 changes: 20 additions & 3 deletions src/main/java/GUI/Blocks/Factories/WhileGUIFactory.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
package GUI.Blocks.Factories;

import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUICavityBlock;

/**
* A factory to create while GUI blocks.
*
* @author Alpha-team
*/
public class WhileGUIFactory extends GUIFactory {
private String name = "While";

/**
* Variable referring to the name of a while block.
*/
private static final String name = "While";

/**
* Create a new while block with given id and coordinates.
*
* @param id The id for the block to create.
* @param x The x coordinate for the block to create.
* @param y The y coordinate for the block to create.
*
* @return A new cavity block block with given id and coordinates and the correct name.
*/
@Override
public GUIBlock createBlock(String id, int x, int y) {
public GUICavityBlock createBlock(String id, int x, int y) {
return new GUICavityBlock(name, id, x, y);
}
}
Loading

0 comments on commit 41f70eb

Please sign in to comment.