void Engine_Collision(string arg1, string arg2) { var side1 = new CollisionSide { ObjectId = arg1 }; var side2 = new CollisionSide { ObjectId = arg2 }; FindControllableObject(side1); FindControllableObject(side2); if (cases.Any(z => z.Offender.Match(side1) && z.Victim.Match(side2))) { return; } cases.Add(new CollisionCase { Offender = side1, Victim = side2 }); cases.Add(new CollisionCase { Offender = side2, Victim = side1 }); if (!triggerSet) { triggerSet = true; world.Clocks.AddTrigger(new OneTimeTrigger(world.Clocks.CurrentTime + CooldownTime, Resolve)); } }
public bool Match(CollisionSide side) { if (IsControllable != side.IsControllable) return false; if (IsControllable) return ControllerId == side.ControllerId; return ObjectId == side.ObjectId; }
public bool Match(CollisionSide side) { if (IsControllable != side.IsControllable) { return(false); } if (IsControllable) { return(ControllerId == side.ControllerId); } return(ObjectId == side.ObjectId); }
void Engine_Collision(string arg1, string arg2) { var side1 = new CollisionSide { ObjectId = arg1 }; var side2 = new CollisionSide { ObjectId = arg2 }; FindControllableObject(side1); FindControllableObject(side2); if (cases.Any(z => z.Offender.Match(side1) && z.Victim.Match(side2))) return; cases.Add(new CollisionCase { Offender = side1, Victim = side2 }); cases.Add(new CollisionCase { Offender = side2, Victim = side1 }); if (!triggerSet) { triggerSet = true; world.Clocks.AddTrigger(new OneTimeTrigger(world.Clocks.CurrentTime + CooldownTime, Resolve)); } }