コード例 #1
0
        /// ---------------------------
        /// Body Part Storage Methods
        /// ---------------------------
        /// Body parts are capable of storing other body parts, and are themselves stored in either a body part
        /// or a Body Part Container.  Additionally, adding or removing a body part from 'storage' is a two part
        /// process: the storage of the actual body part item, and the connecting of the body part to the health
        /// system.  Think of it like an electronic device: putting it into a storage is like placing it in a
        /// room, adding it to a body is like plugging it in.  If you just put it into a room it wont work until
        /// you plug it in, and you shouldn't try to plug something in until you've moved it into the room first.

        /// To complicate things, a body part doesn't know what 'depth' it is, and only can talk to its parent
        /// (the body part that contains it), and each body part needs to know all of the body parts it does and
        /// doesn't contain in order to coordinate.  We accomplish this by each organ telling its parent when its
        /// contents change, and the parent tell the parent's parent and so on until it reaches the highest container.

        /// <summary>
        /// Adds an object to the body part's internal storage, usually another body part
        /// </summary>
        /// <param name="IngameObject">Object to try and store in the Body Part</param>
        public virtual void AddBodyPart(GameObject IngameObject)
        {
            Storage.ServerTryAdd(IngameObject);
        }