Esempio n. 1
0
        public void CreateRelationshipWith(Character target, Random rng)
        {
            if (target.Id == this.Id)
            {
                throw new ArgumentException("Cannot create relationship with self");
            }

            if (this.AllRelations.Any(r => r.OtherId == target.Id))
            {
                throw new ArgumentException("Relationship with target already exists");
            }

            var newRelation = RelationshipGenerator.CreateRelationship(this, target, rng);

            this.AllRelations.Add(newRelation);
        }
 public RelationshipGeneratorTest()
 {
     _relationshipGenerator = new RelationshipGenerator();
 }