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

Fixed shape dependency check

parent c5ce8868
......@@ -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)
......
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