Beispiel #1
0
        public static void Init()
        {
            funcsCreate = new FuncCreateNode[BTFactory.MaxBuildInIdx + (int)EBTTypeIdxAI.EnumCount];
            //build in types
            funcsCreate[(int)EBTBuildInTypeIdx.BTActionLoop] = () => new BTActionLoop();
            funcsCreate[(int)EBTBuildInTypeIdx.BTActionNonPrioritizedSelector] = () => new BTActionNonPrioritizedSelector();
            funcsCreate[(int)EBTBuildInTypeIdx.BTActionParallel]            = () => new BTActionParallel();
            funcsCreate[(int)EBTBuildInTypeIdx.BTActionPrioritizedSelector] = () => new BTActionPrioritizedSelector();
            funcsCreate[(int)EBTBuildInTypeIdx.BTActionSequence]            = () => new BTActionSequence();
            funcsCreate[(int)EBTBuildInTypeIdx.BTConditionFalse]            = () => new BTConditionFalse();
            funcsCreate[(int)EBTBuildInTypeIdx.BTConditionTrue]             = () => new BTConditionTrue();
            funcsCreate[(int)EBTBuildInTypeIdx.BTPreconditionNot]           = () => new BTPreconditionNot();
            funcsCreate[(int)EBTBuildInTypeIdx.BTPreconditionAnd]           = () => new BTPreconditionAnd();
            funcsCreate[(int)EBTBuildInTypeIdx.BTPreconditionOr]            = () => new BTPreconditionOr();
            funcsCreate[(int)EBTBuildInTypeIdx.BTPreconditionXor]           = () => new BTPreconditionXor();

            //AI Nodes
            funcsCreate[(int)EBTTypeIdxAI.CON_HasReachedTarget] = () => new CON_HasReachedTarget();
            funcsCreate[(int)EBTTypeIdxAI.NOD_Attack]           = () => new NOD_Attack();
            funcsCreate[(int)EBTTypeIdxAI.NOD_MoveTo]           = () => new NOD_MoveTo();
            funcsCreate[(int)EBTTypeIdxAI.NOD_TurnTo]           = () => new NOD_TurnTo();
        }
Beispiel #2
0
        public BTInfo GetClone(FuncCreateNode funcCreate)
        {
            var bytes = ToBytes();

            return(BTInfo.Deserialize(bytes, funcCreate));
        }