add some function doc comments
This commit is contained in:
parent
ef5a4b32fc
commit
bce419d411
|
@ -30,6 +30,10 @@
|
||||||
(s/defn parse-line :- CombatEvent
|
(s/defn parse-line :- CombatEvent
|
||||||
[line :- s/Str
|
[line :- s/Str
|
||||||
options :- ParserOptions]
|
options :- ParserOptions]
|
||||||
|
"parses a single complete line from a combat log and returns a corresponding
|
||||||
|
combat event map with all the descrete pieces of data picked out from the
|
||||||
|
line. returns :id = :ignored for ignored combat log events, and
|
||||||
|
:id = :unknown for unrecognized events"
|
||||||
(let [[timestamp stripped-line] (split-log-timestamp-and-content line)
|
(let [[timestamp stripped-line] (split-log-timestamp-and-content line)
|
||||||
sanitized-line (-> stripped-line
|
sanitized-line (-> stripped-line
|
||||||
(undo-swstats-fixlogstring)
|
(undo-swstats-fixlogstring)
|
||||||
|
@ -51,6 +55,12 @@
|
||||||
(s/defn ^:private active-encounter-processing
|
(s/defn ^:private active-encounter-processing
|
||||||
[event :- CombatEvent
|
[event :- CombatEvent
|
||||||
data :- RaidAnalysis]
|
data :- RaidAnalysis]
|
||||||
|
"processes a combat event within the context of an active encounter. first
|
||||||
|
performs encounter analysis for the event, then attempts to detect if the
|
||||||
|
current active encounter has ended as a result of this event, and if so
|
||||||
|
ends the encounter.
|
||||||
|
should only be called if an encounter is currently active in the current
|
||||||
|
raid analysis data."
|
||||||
(let [data (handle-event event data)]
|
(let [data (handle-event event data)]
|
||||||
(if-let [encounter-end (detect-encounter-end event data)]
|
(if-let [encounter-end (detect-encounter-end event data)]
|
||||||
(end-encounter event encounter-end data)
|
(end-encounter event encounter-end data)
|
||||||
|
@ -59,6 +69,12 @@
|
||||||
(s/defn ^:private out-of-encounter-processing
|
(s/defn ^:private out-of-encounter-processing
|
||||||
[event :- CombatEvent
|
[event :- CombatEvent
|
||||||
data :- RaidAnalysis]
|
data :- RaidAnalysis]
|
||||||
|
"processes a combat event outside the context of an active encounter. all
|
||||||
|
this really does is try to determine if the event triggers the start of a
|
||||||
|
new encounter, and if so begins the encounter + performs encounter analysis
|
||||||
|
for the event.
|
||||||
|
should only be called if an encounter is NOT currently active in the
|
||||||
|
current raid analysis data."
|
||||||
(if-let [encounter-name (detect-encounter-triggered event data)]
|
(if-let [encounter-name (detect-encounter-triggered event data)]
|
||||||
(->> data
|
(->> data
|
||||||
(begin-encounter encounter-name event)
|
(begin-encounter encounter-name event)
|
||||||
|
@ -88,6 +104,8 @@
|
||||||
|
|
||||||
(s/defn parse-log :- (s/maybe RaidAnalysis)
|
(s/defn parse-log :- (s/maybe RaidAnalysis)
|
||||||
[f options]
|
[f options]
|
||||||
|
"parses and performs encounter/raid analysis on the given combat log. returns
|
||||||
|
a raid analysis data set if successful."
|
||||||
(let [line-ending-type (detect-file-line-ending-type f)]
|
(let [line-ending-type (detect-file-line-ending-type f)]
|
||||||
(if-not line-ending-type
|
(if-not line-ending-type
|
||||||
(warn "Could not detect line-ending type in log file. Assuming" :windows)
|
(warn "Could not detect line-ending type in log file. Assuming" :windows)
|
||||||
|
|
Reference in a new issue