mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
implemented CPU player building a land factory
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user