Package mekhq.campaign.roleplay
Class JournalEntry
java.lang.Object
mekhq.campaign.roleplay.JournalEntry
One dated entry in the roleplay journal: either a rich-text note the player wrote, or an automatic Oracle log
record. Entries can be tagged with the plot threads and Oracle characters they involve, so a storyline can be read
on its own.
Notes are stored as HTML; Oracle log records are plain text. getPlainText() gives either as plain
text.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCheck()getDate()getText()getType()booleanisNote()static JournalEntryCreates an empty note.voidsetAnswer(OracleAnswer answer) voidsetCheck(CheckRecord check) voidvoidtagCharacter(OracleCharacter character) Tags this entry with an Oracle character.tagThread(PlotThread thread) Tags this entry with a plot thread.
-
Constructor Details
-
JournalEntry
- Parameters:
date- the in-game date of the entrytype- what kind of entry this istext- the entry's text: HTML for aJournalEntryType.NOTE, plain text otherwise
-
-
Method Details
-
newNote
Creates an empty note.- Parameters:
date- the in-game date of the note- Returns:
- the note
-
getDate
-
setDate
-
getType
-
isNote
public boolean isNote()- Returns:
trueif this is a note the player wrote, rather than an Oracle log record
-
getText
- Returns:
- the stored text: HTML for a note, plain text for an Oracle log record
-
setText
-
getPlainText
- Returns:
- the entry's text with any formatting removed
-
getHtmlBody
- Returns:
- the entry's text as an HTML fragment, suitable for placing inside a larger HTML document
-
getThreads
- Returns:
- the live set of ids of the plot threads this entry is tagged with
-
getCharacters
- Returns:
- the live set of ids of the Oracle characters this entry is tagged with
-
getAnswer
- Returns:
- the Fate Chart question this record logs, or
nullif it is not a Fate Chart record
-
setAnswer
-
getCheck
- Returns:
- the check this record logs, or
nullif it is not a check record
-
setCheck
-
tagThread
Tags this entry with a plot thread.- Parameters:
thread- the thread, ornullto do nothing- Returns:
- this entry, for chaining
-
tagCharacter
Tags this entry with an Oracle character.- Parameters:
character- the character, ornullto do nothing- Returns:
- this entry, for chaining
-