Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
9a032f9b
E
et
项目概览
老鱼er
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9a032f9b
编写于
10月 14, 2014
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理代码
上级
7e2e3a53
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
26 deletion
+19
-26
CSharp/App/Modules/BehaviorTreeModule/AllTreeViewModel.cs
CSharp/App/Modules/BehaviorTreeModule/AllTreeViewModel.cs
+1
-1
CSharp/App/Modules/BehaviorTreeModule/BehaviorTreeModule.csproj
.../App/Modules/BehaviorTreeModule/BehaviorTreeModule.csproj
+0
-1
CSharp/App/Modules/BehaviorTreeModule/OneTreeData.cs
CSharp/App/Modules/BehaviorTreeModule/OneTreeData.cs
+0
-6
CSharp/App/Modules/BehaviorTreeModule/TreeLayout.cs
CSharp/App/Modules/BehaviorTreeModule/TreeLayout.cs
+9
-9
CSharp/App/Modules/BehaviorTreeModule/TreeViewModel.cs
CSharp/App/Modules/BehaviorTreeModule/TreeViewModel.cs
+9
-9
未找到文件。
CSharp/App/Modules/BehaviorTreeModule/AllTreeViewModel.cs
浏览文件 @
9a032f9b
...
...
@@ -16,7 +16,7 @@ namespace Modules.BehaviorTreeModule
private
readonly
Dictionary
<
int
,
TreeViewModel
>
treeViewModelsDict
=
new
Dictionary
<
int
,
TreeViewModel
>();
public
ObservableCollection
<
TreeNodeViewModel
>
rootList
=
public
readonly
ObservableCollection
<
TreeNodeViewModel
>
rootList
=
new
ObservableCollection
<
TreeNodeViewModel
>();
public
ObservableCollection
<
TreeNodeViewModel
>
RootList
...
...
CSharp/App/Modules/BehaviorTreeModule/BehaviorTreeModule.csproj
浏览文件 @
9a032f9b
...
...
@@ -88,7 +88,6 @@
<ItemGroup>
<Compile
Include=
"TreeInfoViewModel.cs"
/>
<Compile
Include=
"AllTreeViewModel.cs"
/>
<Compile
Include=
"OneTreeData.cs"
/>
<Compile
Include=
"TreeLayout.cs"
/>
<Compile
Include=
"TreeView.xaml.cs"
>
<DependentUpon>
TreeView.xaml
</DependentUpon>
...
...
CSharp/App/Modules/BehaviorTreeModule/OneTreeData.cs
已删除
100644 → 0
浏览文件 @
7e2e3a53
namespace
Modules.BehaviorTreeModule
{
public
class
OneTreeData
{
}
}
\ No newline at end of file
CSharp/App/Modules/BehaviorTreeModule/TreeLayout.cs
浏览文件 @
9a032f9b
...
...
@@ -24,9 +24,9 @@
}
for
(
int
i
=
0
;
i
<
treeNodeViewModel
.
Children
.
Count
;
++
i
)
{
var
child
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
i
]);
TreeNodeViewModel
child
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
i
]);
child
.
AncestorModify
=
treeNodeViewModel
.
Modify
+
treeNodeViewModel
.
AncestorModify
;
var
offspring
=
this
.
LeftMostOffspring
(
child
,
currentLevel
+
1
,
searchLevel
);
TreeNodeViewModel
offspring
=
this
.
LeftMostOffspring
(
child
,
currentLevel
+
1
,
searchLevel
);
if
(
offspring
==
null
)
{
continue
;
...
...
@@ -45,9 +45,9 @@
}
for
(
int
i
=
treeNodeViewModel
.
Children
.
Count
-
1
;
i
>=
0
;
--
i
)
{
var
child
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
i
]);
TreeNodeViewModel
child
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
i
]);
child
.
AncestorModify
=
treeNodeViewModel
.
Modify
+
treeNodeViewModel
.
AncestorModify
;
var
offspring
=
this
.
RightMostOffspring
(
child
,
currentLevel
+
1
,
searchLevel
);
TreeNodeViewModel
offspring
=
this
.
RightMostOffspring
(
child
,
currentLevel
+
1
,
searchLevel
);
if
(
offspring
==
null
)
{
continue
;
...
...
@@ -66,8 +66,7 @@
right
.
AncestorModify
=
0
;
for
(
int
i
=
0
;
tLeft
!=
null
&&
tRight
!=
null
;
++
i
)
{
double
tGap
=
(
tRight
.
Prelim
+
tRight
.
AncestorModify
)
-
(
tLeft
.
Prelim
+
tLeft
.
AncestorModify
);
double
tGap
=
(
tRight
.
Prelim
+
tRight
.
AncestorModify
)
-
(
tLeft
.
Prelim
+
tLeft
.
AncestorModify
);
if
(
XGap
+
TreeNodeViewModel
.
Width
-
tGap
>
offset
)
{
offset
=
XGap
+
TreeNodeViewModel
.
Width
-
tGap
;
...
...
@@ -85,8 +84,8 @@
{
for
(
int
j
=
i
+
1
;
j
<
treeNodeViewModel
.
Children
.
Count
;
++
j
)
{
var
left
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
i
]);
var
right
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
j
]);
TreeNodeViewModel
left
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
i
]);
TreeNodeViewModel
right
=
this
.
treeViewModel
.
Get
(
treeNodeViewModel
.
Children
[
j
]);
this
.
AjustSubTreeGap
(
left
,
right
);
}
}
...
...
@@ -170,8 +169,9 @@
}
}
public
void
ExcuteLayout
(
TreeNodeViewModel
root
)
public
void
ExcuteLayout
()
{
TreeNodeViewModel
root
=
this
.
treeViewModel
.
Root
;
if
(
root
==
null
)
{
return
;
...
...
CSharp/App/Modules/BehaviorTreeModule/TreeViewModel.cs
浏览文件 @
9a032f9b
...
...
@@ -33,7 +33,7 @@ namespace Modules.BehaviorTreeModule
this
.
treeNodeDict
[
treeNodeViewModel
.
Id
]
=
treeNodeViewModel
;
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
public
TreeViewModel
(
List
<
TreeNodeData
>
treeNodeDatas
)
...
...
@@ -45,7 +45,7 @@ namespace Modules.BehaviorTreeModule
this
.
treeNodeDict
[
treeNodeViewModel
.
Id
]
=
treeNodeViewModel
;
}
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
public
List
<
TreeNodeData
>
GetDatas
()
...
...
@@ -92,7 +92,7 @@ namespace Modules.BehaviorTreeModule
}
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
private
void
GetChildrenIdAndSelf
(
TreeNodeViewModel
treeNodeViewModel
,
List
<
int
>
children
)
...
...
@@ -130,7 +130,7 @@ namespace Modules.BehaviorTreeModule
}
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
private
void
RecursionMove
(
...
...
@@ -180,7 +180,7 @@ namespace Modules.BehaviorTreeModule
to
.
Children
.
Add
(
from
.
Id
);
from
.
Parent
=
to
;
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
/// <summary>
...
...
@@ -201,7 +201,7 @@ namespace Modules.BehaviorTreeModule
treeNodeViewModel
.
IsFold
=
true
;
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
/// <summary>
...
...
@@ -222,7 +222,7 @@ namespace Modules.BehaviorTreeModule
}
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
public
void
MoveLeft
(
TreeNodeViewModel
treeNodeViewModel
)
...
...
@@ -241,7 +241,7 @@ namespace Modules.BehaviorTreeModule
parent
.
Children
.
Insert
(
index
-
1
,
treeNodeViewModel
.
Id
);
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
public
void
MoveRight
(
TreeNodeViewModel
treeNodeViewModel
)
...
...
@@ -260,7 +260,7 @@ namespace Modules.BehaviorTreeModule
parent
.
Children
.
Insert
(
index
+
1
,
treeNodeViewModel
.
Id
);
var
treeLayout
=
new
TreeLayout
(
this
);
treeLayout
.
ExcuteLayout
(
this
.
Root
);
treeLayout
.
ExcuteLayout
();
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录