Beispiel #1
0
 private void ResetMemoryInternal(MyBehaviorTree behaviorTree, MyPerTreeBotMemory treeMemory)
 {
     for (int i = 0; i < behaviorTree.TotalNodeCount; i++)
     {
         treeMemory.AddNodeMemory(behaviorTree.GetNodeByIndex(i).GetNewMemoryObject());
     }
 }
Beispiel #2
0
 public bool ValidateMemoryForBehavior(MyBehaviorTree behaviorTree)
 {
     bool isValid = true;
     if (CurrentTreeBotMemory.NodesMemoryCount != behaviorTree.TotalNodeCount)
         isValid = false;
     else
     {
         for (int i = 0; i < CurrentTreeBotMemory.NodesMemoryCount; i++)
         {
             var nodeMemory = CurrentTreeBotMemory.GetNodeMemoryByIndex(i);
             if (nodeMemory.GetType() != behaviorTree.GetNodeByIndex(i).MemoryType)
             {
                 isValid = false;
                 break;
             }
         }
     }
     return isValid;
 }