Remove obsolete functions from Traits.Util.

This commit is contained in:
Paul Chote
2013-07-22 20:42:33 +12:00
parent 3fd01cfac2
commit e08445f762
2 changed files with 1 additions and 27 deletions

View File

@@ -84,31 +84,11 @@ namespace OpenRA.Traits
return a / step;
}
public static float2 RotateVectorByFacing(float2 v, int facing, float ecc)
{
var angle = (facing / 256f) * (2 * (float)Math.PI);
var sinAngle = (float)Math.Sin(angle);
var cosAngle = (float)Math.Cos(angle);
return new float2(
(cosAngle * v.X + sinAngle * v.Y),
ecc * (cosAngle * v.Y - sinAngle * v.X));
}
public static PPos CenterOfCell(CPos loc)
{
return loc.ToPPos() + new PVecInt(Game.CellSize / 2, Game.CellSize / 2);
}
public static WPos BetweenCells(CPos from, CPos to)
{
return WPos.Lerp(from.CenterPosition, to.CenterPosition, 1, 2);
}
public static int2 AsInt2(this int[] xs) { return new int2(xs[0], xs[1]); }
public static float2 RelOffset(this int[] offset) { return new float2(offset[0], offset[1]); }
public static float2 AbsOffset(this int[] offset) { return new float2(offset.ElementAtOrDefault(2), offset.ElementAtOrDefault(3)); }
public static Activity SequenceActivities(params Activity[] acts)
{
return acts.Reverse().Aggregate(
@@ -133,11 +113,6 @@ namespace OpenRA.Traits
return act;
}
public static Color ArrayToColor(int[] x) { return Color.FromArgb(x[0], x[1], x[2]); }
[Obsolete("Use ToCPos() method", true)]
public static int2 CellContaining(float2 pos) { return (1f / Game.CellSize * pos).ToInt2(); }
/* pretty crap */
public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> ts, Thirdparty.Random random)
{