--
-- Copyright (c) 2014 YouMi Information Technology Inc.
-- Copyright (c) 2020 TianJi Information Technology Inc.
--
-- 行为树 - 装饰节点
--
-- https://docs.unrealengine.com/zh-CN/Engine/ArtificialIntelligence/BehaviorTrees/BehaviorTreeNodeReference/BehaviorTreeNodeReferenceDecorators/index.html
--


local DecoratorBase = class("DecoratorBase")

function DecoratorBase:ctor(manager, cfgs, nodeID)
	self.manager = manager
	self.id = nodeID
	self.cfg = cfgs[nodeID]
	self.child = nil

	assert(#cfg.childNodes == 1, "decorator child size must be 1")
	for _, childID in ipairs(cfg.childNodes) do
		self.child = behavior.newNode(manager, cfgs, childID)
	end
	return self
end


-- 黑板（Blackboard）
-- 节点将检查给定的 黑板键（Blackboard Key） 上是否设置了值。
-- 比较黑板条目（Compare BBEntries）
-- 节点将比较两个 黑板键 的值，并根据结果（等于或不等）阻止或允许节点的执行。
local Blackboard = class("Blackboard", DecoratorBase)
behavior.Blackboard = Blackboard

function Blackboard:ctor(manager, cfgs, nodeID)
	DecoratorBase.ctor(self, manager, cfgs, nodeID)

	self.
end

function Blackboard:update(delta)

end

