Much work on tidying documentation, not yet complete.

This commit is contained in:
Simon Brooke 2020-04-15 16:40:59 +01:00
parent 7e7a55c8ec
commit 3fcf16e079
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
43 changed files with 1233 additions and 267 deletions

View file

@ -1,7 +1,7 @@
(ns the-great-game.gossip.news-items
"Categories of news events interesting to gossip agents"
(:require [the-great-game.world.location :refer [distance-between]]
[the-great-game.time :refer [now]]))
[the-great-game.time :refer [game-time]]))
;; The ideas here are based on the essay 'The spread of knowledge in a large
;; game world', q.v.; they've advanced a little beyond that and will doubtless
@ -136,12 +136,14 @@
(count
(filter
#(some (fn [x] (= x location)) (:location %))
(:knowledge gossip)))))
(cons {:location (:home gossip)} (:knowledge gossip))))))
;; (interest-in-location {:home [{0, 0} :test-home] :knowledge []} [:test-home])
(defn interesting-location?
"True if the location of this news `item` is interesting to this `gossip`."
[gossip item]
(> (interest-in-location gossip (:location item)) 1))
(> (interest-in-location gossip (:location item)) 0))
(defn interesting-object?
[gossip object]
@ -224,7 +226,7 @@
(number? (:nth-hand item))
(inc (:nth-hand item))
1)
:date (if (number? (:date item)) (:date item) (now))
:date (if (number? (:date item)) (:date item) (game-time))
:location (degrade-location gossip (:location item))
;; ought to degratde the location
;; ought to maybe-degrade characters we're not yet interested in