Game Development Reference
In-Depth Information
Creating a blackboard
Creating a blackboard is relatively simple, as the blackboard can be represented almost en-
tirely by an associated array index by knowledge attribute names. One small caveat to
simply storing attributes, though, is the use of knowledge sources that create read-only at-
tributes within the blackboard:
Blackboard.lua :
Blackboard = {};
function Blackboard.new(userData)
local blackboard = {};
-- The Blackboard's data members.
blackboard.attributes_ = {};
blackboard.sources_ = {};
blackboard.userData_ = userData;
return blackboard;
end
Search WWH ::




Custom Search