public bool Create(GameLogic.game_LoadSceneInfo info) { m_Offset = new UnityEngine.Vector3(info.fOffx, info.fOffy, info.fOffz); int[] grid = new int[2]; grid[0] = info.nXAxisLen / MapFinderManager.DEFAULT_GRID_SIZE + 1; grid[1] = info.nZAxisLen / MapFinderManager.DEFAULT_GRID_SIZE + 1; m_gridTree = new GridTree(); m_gridTree.create(UnityEngine.Vector3.zero, grid, MapFinderManager.DEFAULT_GRID_SIZE); return(true); }
public ActionResult GetTreeGridJson(string moduleId) { var data = App.GetButtonList(moduleId); var treeList = new List <GridTree>(); foreach (var item in data) { var treeModel = new GridTree(); var hasChildren = data.Count(t => t.ParentId == item.Id) == 0 ? false : true; treeModel.Id = item.Id; treeModel.IsLeaf = hasChildren; treeModel.ParentId = item.ParentId; treeModel.Expanded = hasChildren; treeModel.EntityJson = item.ToJson(); treeList.Add(treeModel); } return(Content(treeList.TreeGridJson())); }
public ActionResult GetTreeGridJson() { var data = App.GetAll(); var treeList = new List <GridTree>(); foreach (var item in data) { var treeModel = new GridTree(); var hasChildren = data.Count(t => t.ParentId == item.Id) != 0; treeModel.Id = item.Id; treeModel.IsLeaf = hasChildren; treeModel.ParentId = item.ParentId; treeModel.Expanded = hasChildren; treeModel.EntityJson = item.ToJson(); treeList.Add(treeModel); } return(Content(treeList.TreeGridJson())); }
public ActionResult GetTree(string keyword) { var data = App.GetList(); if (!string.IsNullOrEmpty(keyword)) { data = data.TreeWhere(t => t.Name.Contains(keyword)); } var treeList = new List <GridTree>(); foreach (var item in data) { var treeModel = new GridTree(); var hasChildren = data.Count(t => t.ParentId == item.Id) != 0; treeModel.Id = item.Id; treeModel.IsLeaf = hasChildren; treeModel.ParentId = item.ParentId; treeModel.Expanded = false; treeModel.EntityJson = item.Serialize(); treeList.Add(treeModel); } return(Result.PagingRst(treeList.TreeGridJson().Deserialize <object>())); }
public static void Set <T>(this GridTree <T> g, XY xy, T t) => g.Set(xy.xi, xy.yi, t);
public static T At <T>(this GridTree <T> g, XY xy) => g.At(xy.xi, xy.yi);
public static T Get <T>(this GridTree <T> g, XY xy) => g.Get(xy.xi, xy.yi);
// 释放 public void Release() { m_gridTree.Release(); m_gridTree = null; }