コード例 #1
0
 /// <summary>
 /// Adds an IPossessible construct, such as a person place or thing, to the collection of IEntity instances the RelativePronoun "Owns",
 /// and sets its owner to be the RelativePronoun.
 /// If the item is already possessed by the current instance, this method has no effect.
 /// </summary>
 /// <param name="possession">The possession to add.</param>
 public void AddPossession(IPossessable possession)
 {
     if (IsBound)
     {
         RefersTo.AddPossession(possession);
     }
     else
     {
         possessions          = possessions.Add(possession);
         possession.Possessor = this;
     }
 }
コード例 #2
0
 /// <summary>
 /// Adds an IPossessible construct, such as a person place or thing, to the collection of Pronoun "Owns",
 /// and sets its owner to be the Pronoun.
 /// If the item is already possessed by the current instance, this method has no effect.
 /// </summary>
 /// <param name="possession">The possession to add.</param>
 public virtual void AddPossession(IPossessable possession)
 {
     if (RefersTo != null)
     {
         RefersTo.AddPossession(possession);
     }
     else
     {
         possessions.Add(possession);
         possession.Possessor = this;
     }
 }