Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pieter Koopman
Personal Prof public repository
Commits
0b1a9e37
Commit
0b1a9e37
authored
Apr 18, 2020
by
Rick van der Wal
Browse files
Fixed shape dependency check
parent
c5ce8868
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/AssignmentSnakeRules.rsc
View file @
0b1a9e37
...
...
@@ -20,27 +20,27 @@ set[Message] aSnake_model_separated(M3 model) = classDependsOn(model, "World", j
set[Message] aSnake_view_separated(M3 model)
{
// Check if no classes other than SnakeGame contain JavaFX shapes
//
set[loc] shapeClasses =
//
{ |java+class:///javafx/scene/shape/Circle|
//
, |java+class:///javafx/scene/shape/Rectangle|
//
, |java+class:///javafx/scene/shape/Polygon|
//
, |java+class:///javafx/scene/shape/Ellipse|
//
, |java+class:///javafx/scene/shape/Line|
//
, |java+class:///javafx/scene/shape/Arc|
//
};
//
set[loc] createdClasses =
//
{ findClass(model, "Main")
//
, findClass(model, "Segment")
//
, findClass(model, "Snake")
//
, findClass(model, "Food")
//
, findClass(model, "World")
//
};
//
return { error("<getName(model, shapeClass)> is part of the model and should be moved to SnakeGame", createdClass)
//
| createdClass <- createdClasses
//
, shapeClass <- shapeClasses
//
, shapeClass in allTypeDependenciesLoc(model, createdClass)
//
};
return { error("<allTypeDependenciesLoc(model, findClass(model, "Food"))>", findClass(model, "Main")) };
set[loc] shapeClasses =
{ |java+class:///javafx/scene/shape/Circle|
, |java+class:///javafx/scene/shape/Rectangle|
, |java+class:///javafx/scene/shape/Polygon|
, |java+class:///javafx/scene/shape/Ellipse|
, |java+class:///javafx/scene/shape/Line|
, |java+class:///javafx/scene/shape/Arc|
};
set[loc] createdClasses =
{ findClass(model, "Main")
, findClass(model, "Segment")
, findClass(model, "Snake")
, findClass(model, "Food")
, findClass(model, "World")
};
return { error("<getName(model, shapeClass)> is part of the model and should be moved to SnakeGame", createdClass)
| createdClass <- createdClasses
, shapeClass <- shapeClasses
, shapeClass in
model.extends[createdClass] || shapeClass in
allTypeDependenciesLoc(model, createdClass)
};
//
return { error("<allTypeDependenciesLoc(model, findClass(model, "Food"))>", findClass(model, "Main")) };
}
set[Message] aSnake_controller_separated(M3 model)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment