/// <summary> /// CreateDict: Given the root joint, assigns all of the positions of the joints in the joint's dictionary. /// /// <param name="rootJoint"> The joint to store the dictioary in. </param> /// <param name="defaultDict"> The dictionary to store the PositionStorages in. </param> /// /// <returns> The newly generated ObjectSpecs object. </returns> /// </summary> public static void CreateDict(GameObject rootJoint, IDictionary <int, PositionStorage> defaultDict) { ObjectJoint JointObject = rootJoint.GetComponent <ObjectJoint>(); foreach (KeyValuePair <int, GameObject> pair in JointObject.ReferenceDict) { PositionStorage newStorage = new PositionStorage(); newStorage.Rotation = pair.Value.GetComponent <ObjectJoint>().AxisRotation; newStorage.Velocity = pair.Value.GetComponent <ObjectJoint>().LocalVelocity; defaultDict[pair.Key] = newStorage; } }
// Given the root joint, creates a position list to be sent over via protobuf. public void CreateList(GameObject rootJoint, List <PositionStorage> defaultList = null, bool isRoot = true) { List <GameObject> children = rootJoint.GetComponent <ObjectJoint>().ChildJoints; ObjectJoint thisJoint = rootJoint.GetComponent <ObjectJoint>(); PositionStorage newStorage = new PositionStorage(); newStorage.Rotation = thisJoint.AxisRotation; defaultList.Add(newStorage); foreach (GameObject joint in children) { CreateList(joint, defaultList, false); } }
public RFICorrection(IStats playingStyle, int numberOfHandsToStartCorrection) : base(numberOfHandsToStartCorrection) { this.rfi = playingStyle.RFI; }