public void UnassignDevice(InputDevice device) { if (device.GetAssignment().player == this) { device.GetAssignment().Unassign(); } }
public bool AssignDevice(InputDevice device) { if (device.GetAssignment() != null) { // If already assigned to this player, accept as success. Otherwise, fail. if (device.GetAssignment().player == this) { return(true); } else { return(false); } } var assignment = new PlayerDeviceAssignment(this, device); assignment.Assign(); return(true); }