lego-boost.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. The MIT License (MIT)
  3. Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contributors. (https://github.com/NikolaySuslov/livecodingspace/blob/master/LICENSE.md)
  4. Virtual World Framework Apache 2.0 license (https://github.com/NikolaySuslov/livecodingspace/blob/master/licenses/LICENSE_VWF.md)
  5. */
  6. // VWF & OSC model driver
  7. import { Fabric } from '/core/vwf/fabric.js';
  8. class LegoBoostModel extends Fabric {
  9. constructor(module) {
  10. console.log("LegoBoostModel constructor");
  11. super(module, "Model");
  12. }
  13. factory() {
  14. let _self_ = this;
  15. return this.load( this.module,
  16. {
  17. // == Module Definition ====================================================================
  18. // -- pipeline -----------------------------------------------------------------------------
  19. // pipeline: [ log ], // vwf <=> log <=> scene
  20. // -- initialize ---------------------------------------------------------------------------
  21. initialize: function() {
  22. this.objects = {}; // maps id => { property: value, ... }
  23. },
  24. // == Model API ============================================================================
  25. // -- creatingNode -------------------------------------------------------------------------
  26. creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
  27. childSource, childType, childURI, childName, callback /* ( ready ) */ ) {
  28. },
  29. // -- deletingNode -------------------------------------------------------------------------
  30. deletingNode: function( nodeID ) {
  31. },
  32. // -- addingChild --------------------------------------------------------------------------
  33. addingChild: function( nodeID, childID, childName ) {
  34. },
  35. // -- removingChild ------------------------------------------------------------------------
  36. removingChild: function( nodeID, childID ) {
  37. },
  38. // -- parenting ----------------------------------------------------------------------------
  39. parenting: function( nodeID ) {
  40. },
  41. // -- childrening --------------------------------------------------------------------------
  42. childrening: function( nodeID ) {
  43. },
  44. // -- naming -------------------------------------------------------------------------------
  45. naming: function( nodeID ) {
  46. },
  47. // -- creatingProperty ---------------------------------------------------------------------
  48. creatingProperty: function( nodeID, propertyName, propertyValue ) {
  49. // var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  50. // return object[propertyName] = propertyValue;
  51. },
  52. // -- initializingProperty -----------------------------------------------------------------
  53. initializingProperty: function( nodeID, propertyName, propertyValue ) {
  54. // var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  55. // return object[propertyName] = propertyValue;
  56. },
  57. // TODO: deletingProperty
  58. // -- settingProperty ----------------------------------------------------------------------
  59. settingProperty: function( nodeID, propertyName, propertyValue ) {
  60. // var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  61. // return object[propertyName] = propertyValue;
  62. },
  63. // -- gettingProperty ----------------------------------------------------------------------
  64. gettingProperty: function( nodeID, propertyName, propertyValue ) {
  65. // var object = this.objects[nodeID];
  66. // return object && object[propertyName];
  67. },
  68. // -- creatingMethod -----------------------------------------------------------------------
  69. creatingMethod: function( nodeID, methodName, methodParameters, methodBody ) {
  70. },
  71. // TODO: deletingMethod
  72. // -- callingMethod ------------------------------------------------------------------------
  73. callingMethod: function( nodeID, methodName, methodParameters ) {
  74. },
  75. // -- creatingEvent ------------------------------------------------------------------------
  76. creatingEvent: function( nodeID, eventName, eventParameters ) {
  77. },
  78. // TODO: deletingEvent
  79. // -- firingEvent --------------------------------------------------------------------------
  80. firingEvent: function( nodeID, eventName, eventParameters ) {
  81. },
  82. // -- executing ----------------------------------------------------------------------------
  83. executing: function( nodeID, scriptText, scriptType ) {
  84. }
  85. } );
  86. }
  87. }
  88. export {
  89. LegoBoostModel as default
  90. }