Beispiel #1
0
 internal void Add(ArbiterKey key, Arbiter arbiter)
 {
     dictionary.Add(key, arbiter);
 }
Beispiel #2
0
 internal void Remove(Arbiter arbiter)
 {
     lookUpKey.SetBodies(arbiter.body1, arbiter.body2);
     dictionary.Remove(lookUpKey);
 }
Beispiel #3
0
 /// <summary>
 /// Gets an arbiter by it's bodies. Not threadsafe.
 /// </summary>
 /// <param name="body1">The first body.</param>
 /// <param name="body2">The second body.</param>
 /// <param name="arbiter">The arbiter which was found.</param>
 /// <returns>Returns true if the arbiter could be found, otherwise false.</returns>
 public bool LookUpArbiter(RigidBody body1, RigidBody body2, out Arbiter arbiter)
 {
     lookUpKey.SetBodies(body1, body2);
     return(dictionary.TryGetValue(lookUpKey, out arbiter));
 }