Skip to content

Activity Manager

danielbekhter@gmail.com edited this page Feb 23, 2022 · 21 revisions

New classes

Some of the tasks that this class currently has and which should all be separated into own classes:

  • ActivityModel: rename Activity.cs to ActivityModel.cs; this is the data model, already exists
  • ActivityLoader: provide different access methods for loading from web or file no matter whether ARLEM zip or activity.json
  • ActivityParser: Parse activity: Split this into the actual data parsing and into logic that applies data to the scene (ActivitySetup). One of the main things that makes this method problematic is that you cannot just parse the activity on a data level and, e.g., inspect in the code what it contains. By calling the current method ActivityParser(), immediately everything changes in the scene, setting up all necessary GameObjects, manipulating the user interfaces, etc.
  • ActivityView: once the data model is parsed, the view receives the data translated by the ActivitySceneManager as gameobjects
  • ActivitySceneSetup: setup and arrange augmentations in the scene (may not be the perfect name yet!)
  • WorkplaceController: Control workplace manager (this requires refactoring the WorkplaceManager as well - doing the same split between WorkplaceParser, may require WorkplaceSetup and WorkplaceController/ WorkplaceRecorderController)
  • WorkplaceLoader: provide different access methods for loading from file (or other) the workplace.json
  • WorkplaceParser: parse the workplace
  • ActivityController:
    • Viewer: initialization; move back / next between action steps; resuming activities (restoreState); keeping track of the current action step; Handling the GameObject shifting to switch from one step to another ('Keep Alive')
    • Editing the activity: adding and removing activity steps; adding and removing augmentations for a step - or would we keep this with the ActivityController?

Diagram

graph TD;
  ActivityManager --> ActivityLoader;
  ActivityManager --> ActivitySceneSetup;
  ActivitySceneSetup --> ActivityView;
  ActivityLoader --> ActivityParser;
  ActivityParser --> ActivityModel;
  ActivityManager --> ActivityViewerController;
  ActivityManager --> ActivityEditorController;
  ActivityController --> ActivityView;
  ActivityController --> ActivityModel;
  ActivityModel --> WorkplaceModel;
  ActivityManager --> WorkplaceLoader;
  WorkplaceLoader --> WorkplaceModel;
Loading

Classes

ActivityManagerCD