/// <summary> /// Adds an IPossessable construct, such as a person place or thing, to the collection of Entity instances the PossessivePronoun "Owns", /// and sets its owner to be the PossessivePronoun. /// 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) { PossessesFor?.AddPossession(possession); possessions = possessions.Add(possession); }
/// <summary> /// Returns a string representation of the PossessivePronoun. /// </summary> /// <returns>A string representation of the PossessivePronoun.</returns> public override string ToString() => base.ToString() + PossessesFor.Match() .When(VerboseOutput) .Then(e => $"\nSignifying {e.Text} as possessing {Possessions.Format(x => x.Text)}") .Result(string.Empty);
/// <summary> /// Adds a possession to the collection of items this instance possesses. /// </summary> /// <param name="possession">The possession to add.</param> public void AddPossession(IPossessable possession) { PossessesFor = PossessesFor ?? PreviousWord as IEntity; PossessesFor?.AddPossession(possession); possessions = possessions.Add(possession); }