示例#1
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="manifest">The Manifest that will be used to initialized this MachinationsGameObject.</param>
 /// <param name="onBindersUpdated">When a <see cref="MachinationsGameObject"/> enrolls itself
 /// using <see cref="MachinationsGameLayer.EnrollGameObject"/>, this event WILL fire if the MachinationsGameLayer
 /// has been initialized. So, this is why it is allowed to send an EventHandler callback upon Construction.
 /// </param>
 public MachinationsGameObject(MachinationsGameObjectManifest manifest, EventHandler onBindersUpdated = null)
 {
     _gameObjectName = manifest.GameObjectName;
     _manifest       = manifest;
     foreach (DiagramMapping diagramMapping in _manifest.PropertiesToSync)
     {
         CreateBinder(diagramMapping);
     }
     //Assign event, if any was provided. This has to be done before EnrollGameObject, because that function
     //may call MGLInitComplete, which may in turn call OnBindersUpdated.
     if (onBindersUpdated != null)
     {
         OnBindersUpdated = onBindersUpdated;
     }
     MachinationsGameLayer.EnrollGameObject(this);
 }
示例#2
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="manifest">The Manifest that will be used to initialized this MachinationsGameAwareObject.</param>
 /// <param name="onBindersUpdated">When a <see cref="MachinationsGameObject"/> enrolls itself
 /// using <see cref="MachinationsGameLayer.EnrollGameObject"/>, this event WILL fire if the MachinationsGameLayer
 /// has been initialized. So, this is why it is allowed to send an EventHandler callback upon Construction.
 /// </param>
 public MachinationsGameAwareObject(MachinationsGameObjectManifest manifest, EventHandler onBindersUpdated = null) :
     base(manifest, onBindersUpdated)
 {
 }