提交 cf17b5b4 编写于 作者: T tanghai

行为树节点按字母排序

上级 0a4f447f
......@@ -15,7 +15,7 @@ namespace Modules.BehaviorTreeModule
{
return "";
}
var list = (List<string>) value;
var list = ((List<string>) value);
return String.Join(",", list);
}
......@@ -25,7 +25,7 @@ namespace Modules.BehaviorTreeModule
{
return new List<string>();
}
var s = (string) value;
string s = (string) value;
s = s.Trim();
if (s == "")
{
......
using System;
using System.Windows;
using System.Windows.Controls;
using Common.Helper;
namespace Modules.BehaviorTreeModule
{
......@@ -10,11 +9,14 @@ namespace Modules.BehaviorTreeModule
/// </summary>
public partial class NodeDataEditor
{
private readonly string[] nodeTypes;
public NodeDataEditor()
{
this.InitializeComponent();
string[] nodeTypes = Enum.GetNames(typeof (NodeType));
nodeTypes = Enum.GetNames(typeof (NodeType));
Array.Sort(nodeTypes);
this.cbType.ItemsSource = nodeTypes;
}
......@@ -38,7 +40,9 @@ namespace Modules.BehaviorTreeModule
{
return;
}
this.cbType.SelectedIndex = EnumHelper.EnumIndex<NodeType>(this.TreeNodeViewModel.Type);
string typeStr = ((NodeType) this.TreeNodeViewModel.Type).ToString();
int selectIndex = Array.IndexOf(nodeTypes, typeStr);
this.cbType.SelectedIndex = selectIndex;
}
private void CbType_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
......
......@@ -19,8 +19,6 @@ namespace Network
Task<IChannel> GetChannel(string host, int port);
Task<IChannel> GetChannel(string address);
Task<IChannel> GetChannel();
void Remove(IChannel channel);
......
......@@ -108,13 +108,6 @@ namespace TNet
return await ConnectAsync(host, port);
}
public async Task<IChannel> GetChannel(string address)
{
string[] ss = address.Split(':');
int port = Convert.ToInt32(ss[1]);
return await GetChannel(ss[0], port);
}
public void RunOnce(int timeout)
{
poller.Run(timeout);
......
......@@ -67,13 +67,6 @@ namespace UNet
return channel;
}
public async Task<IChannel> GetChannel(string address)
{
string[] ss = address.Split(':');
int port = Convert.ToInt32(ss[1]);
return await GetChannel(ss[0], port);
}
public async Task<IChannel> GetChannel(string host, int port)
{
UChannel channel = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册