implemented CPU player building a land factory

This commit is contained in:
devZoGok
2023-12-16 17:26:12 +02:00
parent eee806b3b8
commit 4e59cdcd75
13 changed files with 167 additions and 37 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
BTNodeType = {SELECTOR = 0, SEQUENCE = 1, FUNCTION = 2}
function executeBtNode(btNode)
function executeBtNode(agent, btNode)
for i = 1, #btNode.children do
if btNode.children[i].type == BTNodeType.FUNCTION then
res = btNode.children[i].func()
func = btNode.children[i].func
res = agent[func](agent)
else
res = executeBtNode(btNode.children[i])
res = executeBtNode(agent, btNode.children[i])
end
if btNode.type == BTNodeType.SELECTOR then