public static GlobalsBlock[] FromBlock(TI.IBlock block) { TI.IElementArray ea = block.GetElements(); GlobalsBlock[] value = new GlobalsBlock[ea.Count]; hs_globals_block hs; for (int x = 0; x < value.Length; x++) { hs = (hs_globals_block)ea.GetElement(x); var v = value[x] = new GlobalsBlock(); v.Name = hs.Name.Value; v.Type = (short)hs.Type.Value; Blam.DatumIndex index = hs.InitExpressionIndex.Value; v.NodeOffset = index.Index; // We have to dynamically caluclate the node counts as // some globals are set at runtime, ie '(* 20 seconds)' v.NodeCount = -1; } return(value); }
public static GlobalsBlock[] FromBlock(TI.IBlock block) { TI.IElementArray ea = block.GetElements(); GlobalsBlock[] value = new GlobalsBlock[ea.Count]; hs_globals_block hs; for (int x = 0; x < value.Length; x++) { hs = (hs_globals_block)ea.GetElement(x); var v = value[x] = new GlobalsBlock(); v.Name = hs.Name.Value; v.Type = (short)hs.Type.Value; Blam.DatumIndex index = hs.InitExpressionIndex.Value; v.NodeOffset = index.Index; // We have to dynamically caluclate the node counts as // some globals are set at runtime, ie '(* 20 seconds)' v.NodeCount = -1; } return value; }