public Bone BoneAddChild(Bone root, float x, float y, float a, int l, BoneFlag flag, string name) { Bone t = null; int i; if (root == null)// || root.Parent == null) { root = new Bone(); root.Parent = null; root.X = x; root.Y = y; root.Angle = a; root.Length = l; root.Flag = flag; root.Name = string.Copy(name); return root; } else if (root.ChildBones.Length < 11) { t = new Bone(); t.Parent = root; t.X = x; t.Y = y; t.Angle = a; t.Length = l; t.Flag = flag; t.Name = string.Copy(name); root.ChildBones[root.ChildCount] = t; root.ChildCount++; return root; } else return null; }
public static bool Has(this BoneFlag source, BoneFlag flag) { return((source & flag) == flag); }
public Bone BoneAddChild2(Bone root, Vector2 pos, float a, int l, BoneFlag flag, string name) { Bone t = null; int i; if (root == null)// || root.Parent == null) { root = new Bone(); root.Parent = null; } else if (root.ChildBones.Length < 11) { t = new Bone(); t.Parent = root; root.ChildBones[root.ChildCount] = t; root.ChildCount++; root = t; //return root; } else return null; root.boneStart = pos; root.Angle = a; root.Length = l; root.Flag = flag; root.Name = string.Copy(name); return root; }