コード例 #1
0
        private IGameObj FindObj(string objPath)
        {
            Group curGroup = this.groups;

            string[] paths;
            paths = objPath.Split('\\');
            for (int i = 0; i < paths.Length - 1; i++)
            {
                curGroup = curGroup.GetChildGroup(paths[i]);
                if (curGroup == null)
                {
                    Log.Write("FindObj: 错误的组路径被传入或不存在匹配组");
                    return(null);
                }
            }
            if (curGroup != null && curGroup is TypeGroup)
            {
                return((curGroup as TypeGroup).GetObj(paths[paths.Length - 1]));
            }
            return(null);
        }
コード例 #2
0
        private Group FindGroup(string groupPath)
        {
            if (groupPath == string.Empty)
            {
                return(this.groups);
            }

            Group curGroup = this.groups;

            string[] paths;
            paths = groupPath.Split('\\');
            foreach (string path in paths)
            {
                curGroup = curGroup.GetChildGroup(path);
                if (curGroup == null)
                {
                    Log.Write("FindGroup: 错误的组路径被传入或不存在匹配组");
                    return(null);
                }
            }
            return(curGroup);
        }