description.module
README.md
description
What the pursuers know the suspect looks like, and losing it.
A description is a set of tags with values ("jacket" = "ochre", "vehicle.kind" = "van", "vehicle.colour" =
"blue", "vehicle.plate" = "VR 1123"), noted when the suspect
is identified. While the suspect's current appearance matches any noted tag, observers treat it as worth
looking at (perception's `described`). Changing the thing a tag describes, out of sight, sheds that tag.
local Description = require("~.modules.description")
local d = Description.new()
d:note({ jacket = "ochre", vehicle = "blue van" })
d:matches({ jacket = "ochre" }) -- true, { "jacket" }
d:matches({ jacket = "grey", vehicle = nil }) -- false, {} (on foot, jacket turned)
d:strength({ jacket = "ochre" }) -- 0..1: the share of what they know that the appearance matches
d:shed("jacket") -- they no longer know the jacket (returns true if they did)
d:known() -- { jacket = "ochre", ... } a copy, for UI
d:clear()
The interface is documented in the header of init.luau; this file repeats it for the asset browser.