programmingMaze, code clean-up final revision
ClosedPublic

Authored by amankumargupta on Apr 21 2018, 9:50 PM.

Details

Summary

This diff mainly focuses on generalizing the object creation, destroying and accessing process of the instruction objects while executing the user's code.

Previously, the object creation and destroying code for both didn't follow the same process/behaviour. In this diff, the code have been refactored to have same behaviour and the other changes which are very important for the extension for programmingMaze loops activity.

Now we maintain two look-up tables for main and procedure respectively and we create the instructions for each at the starting of the levels and they can be accessed to execute the instruction when needed, and destroyed at the end of the level (which was previously done only for procedure).

This is certainly better, more readible, and most importantly having the code to follow the same behaviour for both.

Diff Detail

Repository
R2 GCompris
Lint
Lint Skipped
Unit
Unit Tests Skipped
amankumargupta created this revision.Apr 21 2018, 9:50 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptApr 21 2018, 9:50 PM
Restricted Application added a subscriber: KDE Edu. · View Herald Transcript
amankumargupta requested review of this revision.Apr 21 2018, 9:50 PM
amankumargupta edited the summary of this revision. (Show Details)
jjazeix added inline comments.
src/activities/programmingMaze/programmingMaze.js
206 ↗(On Diff #32752)

can you create a createInstruction that will create the object and connect the signals to factorise the code?
It will be used here and in the createInstructionObjects function

amankumargupta marked an inline comment as done.Apr 23 2018, 3:58 AM
jjazeix accepted this revision.Apr 23 2018, 7:51 AM
This revision is now accepted and ready to land.Apr 23 2018, 7:51 AM