public AlphaLayer[] GetAlphaBytes() { AlphaLayer[] result = new AlphaLayer[validNums.Length]; for (int layer = 0; layer < validNums.Length; layer++) { List <byte> bytes = new List <byte>(); PreorderTraversal((Node node) => { if (node.childs != null) { byte flag = 0; for (int i = 0; i < 4; i++) { if (node.childs[i].childs == null) { if (node.childs[i].GetValidNum(layer) > 0) { flag |= (byte)(1 << i); } } } bytes.Add(flag); } }); result[layer] = new AlphaLayer(); result[layer].bytes = bytes; } return(result); }
public AlphaLayer[] GetAlphaBytes() { AlphaLayer[] result = new AlphaLayer[validNums.Length]; for (int layer = 0; layer < validNums.Length; layer++) { List <short> nums = new List <short>(); PreorderTraversal((Node node) => { if (node.childs == null) { nums.Add((short)node.validNums[layer]); } }); result[layer] = new AlphaLayer(); result[layer].validNums = nums.ToArray(); } return(result); }