예제 #1
0
 private Node CreateNode(NodeConfig config)
 {
     if (!this.dictionary.ContainsKey(config.Id))
     {
         throw new KeyNotFoundException(string.Format("CreateNode cannot found: {0}", config.Id));
     }
     return(this.dictionary[config.Id](config));
 }
예제 #2
0
        private Node CreateOneNode(NodeConfig proto)
        {
            NodeType nodeType = proto.Type;

            if (!this.dictionary.ContainsKey(nodeType))
            {
                throw new KeyNotFoundException($"NodeType没有定义该节点: {nodeType}");
            }
            return(this.dictionary[nodeType](proto));
        }
예제 #3
0
        private Node CreateTreeNode(NodeConfig proto)
        {
            Node node = this.CreateOneNode(proto);

            if (proto.Children == null)
            {
                return(node);
            }

            foreach (NodeConfig nodeProto in proto.Children)
            {
                Node childNode = this.CreateTreeNode(nodeProto);
                node.AddChild(childNode);
            }
            return(node);
        }
예제 #4
0
        private Node CreateTreeNode(NodeConfig config)
        {
            var node = this.CreateNode(config);

            if (config.SubConfigs == null)
            {
                return(node);
            }

            foreach (var subConfig in config.SubConfigs)
            {
                var subNode = this.CreateTreeNode(subConfig);
                node.AddChild(subNode);
            }
            return(node);
        }
예제 #5
0
		public Selector(NodeConfig config): base(config)
		{
		}
예제 #6
0
파일: Node.cs 프로젝트: rvpoochen/Egametang
 protected Node(NodeConfig config)
 {
     this.config = config;
 }
예제 #7
0
		public Sequence(NodeConfig config): base(config)
		{
		}
예제 #8
0
파일: Node.cs 프로젝트: adan830/Egametang
		protected Node(NodeConfig config)
		{
			this.config = config;
		}
예제 #9
0
        public BehaviorTree CreateTree(NodeConfig config)
        {
            var node = this.CreateTreeNode(config);

            return(new BehaviorTree(node));
        }
예제 #10
0
파일: Not.cs 프로젝트: adan830/Egametang
		public Not(NodeConfig config): base(config)
		{
		}