public bool CanEncounter(Person person)
 {
     return person.Age >= 8
            && person.HasFlag(IdentityFlags.TransgenderFlag)
            && !person.HasFlag(IdentityFlags.TransitionedFlag)
            && !person.HasFlag(IdentityFlags.TransitioningFlag);
 }
 public bool CanEncounter(Person person)
 {
     return (person.Age > 16
         || (person.HasFlag(IdentityFlags.OrphanFlag) && person.Age > 12))
         && !person.HasFlag(TravelFlags.SettledFlag)
         && person.Profession == null;
 }
        public float ScoreEncounter(Person enactor)
        {
            if (enactor.HasFlag(RomanticFlags.DatingFlag))
            {
                return FacetInfluenceEnum.Minor.ToScore()*-1;
            }

            if (enactor.HasFlag(RomanticFlags.EngagedFlag) || enactor.HasFlag(RomanticFlags.MarriedFlag))
            {
                return FacetInfluenceEnum.Major.ToScore()*-1;
            }

            return 0;
        }
 /// <summary>
 /// Simple gate-keeping check to determine if it is even physically possible for this event
 /// to be triggered.
 /// An example would be lighting a car on fire without a car. Without the car,
 /// you couldn't light the fire on said car.
 /// </summary>
 /// <param name="person">The person.</param>
 /// <returns>
 /// Whether or not this encounter can be encountered.
 /// </returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public bool CanEncounter(Person person)
 {
     // For purposes of this simulation, we assume if you're already in a relationship,
     // you won't be dating anyone else.
     //
     // We also assume that boys and girls are gross until about 14.
     //
     // (And that there's someone to date.)
     return person.Partner == null
            && !person.HasFlag(RomanticFlags.DatingFlag)
            && !person.HasFlag(RomanticFlags.EngagedFlag)
            && !person.HasFlag(RomanticFlags.MarriedFlag)
            && person.Age >= 14
            && person.Location.GetPeopleWhere(p => ValidPartner(person, p)).Any();
 }
        public bool Encounter(Person person)
        {
            var mate = person.Partner;

            // Mate them up!
            person.Log("I married {0}.", mate.Name);
            mate.Log("I married {0}. ", person.Name);
            person.AddFlag(RomanticFlags.MarriedFlag);
            mate.AddFlag(RomanticFlags.MarriedFlag);

            if (person.HasFlag(RomanticFlags.EngagedFlag))
            {
                person.ClearFlag(RomanticFlags.EngagedFlag);
                mate.ClearFlag(RomanticFlags.EngagedFlag);
            }

            person.PopulationModule.SaveChanges(mate);

            return true;
        }
 public bool CanEncounter(Person person)
 {
     return person.Age > 16
            && !person.HasFlag(TravelFlags.SettledFlag)
            && person.Profession == null;
 }
 public bool CanEncounter(Person person)
 {
     return person.Partner != null
            && person.Partner.HasFlag(RomanticFlags.DatingFlag)
            && person.HasFlag(RomanticFlags.DatingFlag);
 }
 private static bool ValidPartner(Person seeker, Person potentialPartner)
 {
     return !potentialPartner.HasFlag(RomanticFlags.DatingFlag) || !potentialPartner.HasFlag(RomanticFlags.MarriedFlag) ||
            !potentialPartner.HasFlag(RomanticFlags.EngagedFlag) && potentialPartner.Age >= 14 &&
            potentialPartner.Id != seeker.Id;
 }
        /// <summary>
        /// Scoring an encounter takes various bits about a person and calculates a score
        /// that will be used to determine whether or not this person will do this event.
        /// (This is like a Target Number Modifier in more colloquial games like Dungeons and Dragons,
        /// or Shadowrun)
        /// This specific score provides situational-based modifiers.
        /// </summary>
        /// <param name="enactor">The enactor.</param>
        /// <returns></returns>
        public float ScoreEncounter(Person enactor)
        {
            float score = 0;
            if (enactor.Partner != null)
            {
                score += FacetInfluenceEnum.Minor.ToScore();
            }

            if (enactor.HasFlag(RomanticFlags.DatingFlag))
            {
                score += FacetInfluenceEnum.Minor.ToScore();
            }
            else if (enactor.HasFlag(RomanticFlags.MarriedFlag))
            {
                score += FacetInfluenceEnum.Moderate.ToScore();
            }

            return score;
        }