Relations are stored in Relation
table. They’re simple tags, linking two people together. Links are one way, so if you want to make two people rivals to each other, there needs to be two rows in Relation
table for that.
Relation
originatorId PersonId
targetId PersonId
type RelationType
visibility RelationVisibility
deriving Show Read Eq
You can read row in table as originatorId
is type
to targetId
. For example: “Pete is rival to Uzhag”.
Visibility
Not all relations are known to everyone. This is modeled with visibility
field of type RelationVisibility
. RelationVisibility
is defined as:
data RelationVisibility =
SecretRelation
| FamilyRelation
| PublicRelation
deriving (Show, Read, Eq, Enum, Bounded, Ord)
When the system is building a person report and listing relations of the subject, relation visibilities are considered. Observer has some level of intelligence (stored in HumanIntelligence
) about people being observed that determines what relations exactly are known to them.