예제 #1
0
        /// <summary>
        /// Returns all <see cref="Interaction"/>s the given character is involved in.
        /// </summary>
        /// <param name="character">The character.</param>
        /// <returns>A List of <see cref="Interaction"/> objects containing the character.</returns>
        public List<Interaction> GetInteractions(CharacterData character)
        {
            List<Interaction> interactions = new List<Interaction>();

            interactions.AddRange(Interactions.Where(i => i.Involves(character)));

            return interactions;
        }
예제 #2
0
        /// <summary>
        /// Returns all <see cref="Interaction"/>s between two characters.
        /// </summary>
        /// <param name="firstCharacter">The first character.</param>
        /// <param name="secondCharacter">The second character.</param>
        /// <returns>A List of <see cref="Interaction"/> objects containing both characters.</returns>
        public List<Interaction> GetInteractions(CharacterData firstCharacter, CharacterData secondCharacter)
        {
            List<Interaction> interactions = new List<Interaction>();

            interactions.AddRange(Interactions.Where(i => i.IsBetween(firstCharacter, secondCharacter)));

            return interactions;
        }
예제 #3
0
 /// <summary>
 /// Returns the interaction strenght between two characters.
 /// </summary>
 /// <param name="firstCharacter">The first character.</param>
 /// <param name="secondCharacter">The second character.</param>
 /// <returns>Sum of all interaction strenghts of the Interactions between the characters.</returns>
 public double GetInteractionStrenght(CharacterData firstCharacter, CharacterData secondCharacter)
 {
     // Sum up all interaction strength values
     return GetInteractions(firstCharacter, secondCharacter).Sum(x => x.InteractionStrength);
 }
예제 #4
0
 public bool IsBetween(CharacterData firstCharacter, CharacterData secondCharacter)
 {
     return Equals(PrimaryCharacter, firstCharacter) && Equals(SecondaryCharacter, secondCharacter) ||
            Equals(PrimaryCharacter, secondCharacter) && Equals(SecondaryCharacter, firstCharacter);
 }
예제 #5
0
 public bool Involves(CharacterData character)
 {
     return Equals(character, PrimaryCharacter) || Equals(character, SecondaryCharacter);
 }
예제 #6
0
 public bool IsBetween(CharacterData firstCharacter, CharacterData secondCharacter)
 {
     return(Equals(PrimaryCharacter, firstCharacter) && Equals(SecondaryCharacter, secondCharacter) ||
            Equals(PrimaryCharacter, secondCharacter) && Equals(SecondaryCharacter, firstCharacter));
 }
예제 #7
0
 public bool Involves(CharacterData character)
 {
     return(Equals(character, PrimaryCharacter) || Equals(character, SecondaryCharacter));
 }
예제 #8
0
 /// <summary>
 /// Returns the interaction strenght between two characters.
 /// </summary>
 /// <param name="firstCharacter">The first character.</param>
 /// <param name="secondCharacter">The second character.</param>
 /// <returns>Sum of all interaction strenghts of the Interactions between the characters.</returns>
 public double GetInteractionStrenght(CharacterData firstCharacter, CharacterData secondCharacter)
 {
     // Sum up all interaction strength values
     return(GetInteractions(firstCharacter, secondCharacter).Sum(x => x.InteractionStrength));
 }