Commit bcbc9aef authored by Rick van der Wal's avatar Rick van der Wal
Browse files

Added empty rulesets

parent 1a605f66
module AssignmentSnakeRules
import Message;
import lang::java::m3::Core;
import ClassHierarchy;
import StandardLocations;
set[Message] allAssignmentSnakeRules(M3 model)
= aSnake_view_separated(model)
+ aSnake_controller_separated(model)
;
set[Message] aSnake_view_separated(M3 model)
{
// Check if SnakeGame is the only class that uses JavaFX scene objects
return {};
// Check if SnakeGame itself doesn't contain things that should be in the model
}
set[Message] aSnake_controller_separated(M3 model)
{
// Check if InputHandler is the only class that uses JavaFX EventListeners
// This is more difficult because other classes can add event listeners to scenes
// using a lambda, in which case they don't need the EventListener import
return {};
// Check if InputHandler itself doesn't contain things that should be in the model
}
......@@ -68,9 +68,9 @@ int main(list[str] args)
case "sliding-game": messages += allAssignmentSlidingGameRules(m);
case "quadtrees": messages += allAssignmentQuadtreesRules(m);
case "polynomials": messages += allAssignmentPolynomialsRules(m);
// pie-charts and snake don't have rules, but we still want coding rules and syntax errors
// pie-charts doesn't have rules, but we still want coding rules and syntax errors
case "pie-charts": ;
case "snake": ;
case "snake": messages += allAssignmentSnakeRules(m);
case "propositional": messages += allAssignmentPropositionalRules(m);
case "streams":
{
......
......@@ -9,7 +9,7 @@ import java.util.List;
public class Snake extends Segment {
public interface SnakeSegmentListener {
void onNewSegment(Segment segment);
public void onNewSegment(Segment segment);
}
private Direction direction = Direction.RIGHT;
......
......@@ -9,7 +9,7 @@ import java.util.List;
public class Snake extends Segment {
public interface SnakeSegmentListener {
void onNewSegment(Segment segment);
public void onNewSegment(Segment segment);
}
private Direction direction = Direction.RIGHT;
......
......@@ -9,7 +9,7 @@ import java.util.List;
public class Snake extends Segment {
public interface SnakeSegmentListener {
void onNewSegment(Segment segment);
public void onNewSegment(Segment segment);
}
private Direction direction = Direction.RIGHT;
......
module \test::AssignmentSnakeRulesSpec
import Set;
import lang::java::m3::Core;
import \test::SpecUtil;
import AssignmentSnakeRules;
import CodingRules;
import Util;
test bool aSnakeexampleSolution()
{
M3 model = loadTestProject("snake-example-solution");
errors = allAssignmentSnakeRules(model) + allCodingRules(model);
return isEmpty(errors);
}
test bool aSnakebaseClassesNotAbstract()
{
M3 model = loadTestProject("snake-graphics-not-in-view");
errors = allAssignmentSnakeRules(model);
return
{
} == messages(errors);
}
test bool aSnakevariableNotExtendsOneArgExpr()
{
M3 model = loadTestProject("snake-input-not-in-controller");
errors = allAssignmentSnakeRules(model);
return
{
} == messages(errors);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment