Ejemplo n.º 1
0
 /// <summary>
 /// Mount the accessory to the specified location.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Remounting to a different or same location is allowed.  If a remount fails the accessory will be
 /// released.  This behavior is due to the multiple actors involved.  E.g. The outfit, accessory, and
 /// possibly a mounter. The outfit can't guarentee behavior of all actors, so it implements a behavior that
 /// is consistant.
 /// </para>
 /// </remarks>
 /// <param name="accessory">The accessory to mount. (Required)</param>
 /// <param name="locationType">The location to mount the accessory to.</param>
 /// <param name="ignoreRestrictions">
 /// If true, ignore coverage restrictions and the value of <see cref="AccessoriesLimited"/>.
 /// </param>
 /// <param name="priorityMounter">
 /// The mounter that should be tried before any other mounters.  (Optional)
 /// </param>
 /// <param name="additionalCoverage">
 /// Coverage to add to the accessory if it is successfully mounted, above and beyond any coverage inherent
 /// iin the accessory and/or mounter.
 /// </param>
 /// <returns>The result of the mount attempt.</returns>
 public abstract MountResult Mount(Accessory accessory, MountPointType locationType,
                                   bool ignoreRestrictions, IAccessoryMounter priorityMounter, BodyCoverage additionalCoverage);
Ejemplo n.º 2
0
 void IOutfitObserver.OnMountAccessory(Outfit sender, Accessory accessory)
 {
     // Do nothing.
 }
Ejemplo n.º 3
0
 void IOutfitObserver.OnReleaseAccessory(Outfit sender, Accessory accessory)
 {
     // Do nothing.
 }
 public abstract bool CanMount(Accessory accessory, MountPoint location);
 public virtual void OnAccessoryDestroy(Accessory accessory, DestroyType type)
 {
     // Do nothing.
     // For most scriptable object mounters the main purpose for this is state cleanup of in-progress mounts.
     // So likelihood of use is similar to CancelMount.
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Mount the accessory to the specified location.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Remounting to a different or same location is allowed.  If a remount fails the accessory will be
 /// released.  This behavior is due to the multiple actors involved.  E.g. The outfit, accessory, and
 /// possibly a mounter. The outfit can't guarentee behavior of all actors, so it implements a behavior that
 /// is consistant.
 /// </para>
 /// </remarks>
 /// <param name="accessory">The accessory to mount. (Required)</param>
 /// <param name="locationType">The location to mount the accessory to.</param>
 /// <returns>The result of the mount attempt.</returns>
 public MountResult Mount(Accessory accessory, MountPointType locationType)
 {
     return(Mount(accessory, locationType, false, null, 0));
 }
Ejemplo n.º 7
0
        ////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Unmount and release the the accessory.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The release operation will always succeed if the accessory is is known to the outfit.
        /// </para>
        /// <para>
        /// This method can be called lazily.  It will only take action if the accessory is known to the outfit.
        /// </para>
        /// </remarks>
        /// <param name="accessory">The accessory. (Required.)</param>
        /// <returns>True if an release occurred, false if the accessory is not known to the outfit.</returns>
        public abstract bool Release(Accessory accessory);
 public abstract bool CanMount(Accessory accessory, MountPointType locationType);
 public abstract bool InitializeMount(Accessory accessory, MountPoint location);
 public override bool CanMount(Accessory accessory, MountPointType locationType)
 {
     return(accessory && locationType == m_Location);
 }
 public override bool UpdateMount(Accessory accessory, MountPoint location, bool immediateComplete)
 {
     FinalizeMount(accessory, location.transform);
     return(false);
 }
Ejemplo n.º 12
0
 void IOutfitObserver.OnReleaseAccessory(Outfit sender, Accessory accessory)
 {
     // Handled by accesory manager.
 }
Ejemplo n.º 13
0
 public override bool RemoveAccessory(Accessory accessory)
 {
     CheckAccessoriesInitialized();
     CheckNeedsSoftReset();
     return(m_Accessories.Remove(accessory));
 }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public abstract bool UpdateMount(Accessory accessory, MountPoint location, float deltaTime);
Ejemplo n.º 15
0
        ////////////////////////////////////////////////////////////////////////////////////////////
        // HACK: Unity 5.3.1: Workaround for Mono's optional parameter key duplication bug.

        /// <summary>
        /// Mount the accessory to the specified location.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Remounting to a different or same location is allowed.  If a remount fails the accessory will be
        /// released.  This behavior is due to the multiple actors involved.  E.g. The outfit, accessory, and
        /// possibly a mounter. The outfit can't guarentee behavior of all actors, so it implements a behavior that
        /// is consistant.
        /// </para>
        /// </remarks>
        /// <param name="accessory">The accessory to mount. (Required)</param>
        /// <param name="locationType">The location to mount the accessory to.</param>
        /// <param name="ignoreRestrictions">
        /// If true, ignore coverage restrictions and the value of <see cref="AccessoriesLimited"/>.
        /// </param>
        /// <param name="priorityMounter">
        /// The mounter that should be tried before any other mounters.  (Optional)
        /// </param>
        /// <returns>The result of the mount attempt.</returns>
        public MountResult Mount(Accessory accessory, MountPointType locationType,
                                 bool ignoreRestrictions, IAccessoryMounter priorityMounter)
        {
            return(Mount(accessory, locationType, ignoreRestrictions, priorityMounter, 0));
        }
 public abstract bool UpdateMount(Accessory accessory, MountPoint location, bool immediateComplete);
Ejemplo n.º 17
0
 /// <summary>
 /// Mount the accessory to the specified location.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Remounting to a different or same location is allowed.  If a remount fails the accessory will be
 /// released.  This behavior is due to the multiple actors involved.  E.g. The outfit, accessory, and
 /// possibly a mounter. The outfit can't guarentee behavior of all actors, so it implements a behavior that
 /// is consistant.
 /// </para>
 /// </remarks>
 /// <param name="accessory">The accessory to mount. (Required)</param>
 /// <param name="locationType">The location to mount the accessory to.</param>
 /// <param name="ignoreRestrictions">
 /// If true, ignore coverage restrictions and the value of <see cref="AccessoriesLimited"/>.
 /// </param>
 /// <returns>The result of the mount attempt.</returns>
 public MountResult Mount(Accessory accessory, MountPointType locationType, bool ignoreRestrictions)
 {
     return(Mount(accessory, locationType, ignoreRestrictions, null, 0));
 }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // HACK: Unity 5.3.1: Workaround for Mono's optional parameter key duplication bug.

        public bool UpdateMount(Accessory accessory, MountPoint location)
        {
            return(UpdateMount(accessory, location, false));
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Mount the accessory to its default location.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Remounting to a different or same location is allowed.  If a remount fails the accessory will be
 /// released.  This behavior is due to the multiple actors involved.  E.g. The outfit, accessory, and
 /// possibly a mounter. The outfit can't guarentee behavior of all actors, so it implements a behavior that
 /// is consistant.
 /// </para>
 /// </remarks>
 /// <param name="accessory">The accessory to mount. (Required)</param>
 /// <returns>The result of the mount attempt.</returns>
 public MountResult Mount(Accessory accessory)
 {
     return(Mount(accessory, accessory.DefaultLocationType, false, null));
 }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public virtual void CancelMount(Accessory accessory, MountPoint location)
        {
            // Do nothing.
            // Most mounters are expected to be immediate-complete.  So don't make them all implement this method.
        }
 private void SendUnmount(Accessory accessory)
 {
     Observers.SendRelease(this, accessory);
 }
 private void LinkAccessory(Accessory accessory)
 {
     accessory.AddObserver(this);
     m_Accessories.Add(accessory);
 }