// Copy trait and keep trait type id to identify it as the same relationship elsewhere in the program public Relationship(Relationship anotherRel, StoryEntity originatingEntity, StoryData world) { UInt64 nullTargetId = 0; if (originatingEntity.GetType() == typeof(Character)) { nullTargetId = Character.getNoOneCharacter().Id; } else if (originatingEntity.GetType() == typeof(Environment)) { nullTargetId = Environment.getNoWhereEnvironment().Id; } Constructor(anotherRel.Name, originatingEntity.Id, nullTargetId, 0.0, anotherRel.TypeId, world); }
public Character findCharacterById(UInt64 id) { if (id == NullCharacterId) { return(Character.getNoOneCharacter()); } foreach (Character item in _characters) { if (item.Id == id) { return(item); } } return(null); }
public static List <Character> getCharactersWithNoOne() { if (_storyWorld == null) { return(new List <Character>()); } else { Character NoOne = Character.getNoOneCharacter(); List <Character> charList = _storyWorld.Characters; List <Character> fullCharList = new List <Character>(); fullCharList.AddRange(charList); fullCharList.Add(NoOne); return(fullCharList); } }