14 lines
397 B
C#
14 lines
397 B
C#
using System;
|
|
namespace BITKit
|
|
{
|
|
public static class MathO
|
|
{
|
|
public static void Exchange<T,TValue>(T x,T y,Func<T,object> getFacotry,Action<T,TValue> setFacotry)
|
|
{
|
|
var _x = (TValue)getFacotry.Method.Invoke(x,null);
|
|
var _y = (TValue)getFacotry.Method.Invoke(y,null);
|
|
setFacotry.Invoke(x,_y);
|
|
setFacotry.Invoke(y,_x);
|
|
}
|
|
}
|
|
} |