From 610974085fafc976acd2645455d15c913a99f05b Mon Sep 17 00:00:00 2001 From: "pius.lee" Date: Thu, 19 Oct 2017 08:55:28 +0900 Subject: [PATCH] [ElmSharp] Fix typo AnimatorMotionMapper.Calculate fix caculate to calculate Change-Id: Id7ad81564fad247cfb373c49980ed47974a9cd4f --- ...torMotionMapper.cs => IAnimatorMotionMapper.cs} | 48 +++++++++++----------- .../ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs | 26 ++++++------ .../TC/Wearable/EcoreTimelineAnimatorTest1.cs | 26 ++++++------ 3 files changed, 50 insertions(+), 50 deletions(-) rename src/ElmSharp/ElmSharp/{AnimatorMotionMapper.cs => IAnimatorMotionMapper.cs} (82%) mode change 100755 => 100644 diff --git a/src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs b/src/ElmSharp/ElmSharp/IAnimatorMotionMapper.cs old mode 100755 new mode 100644 similarity index 82% rename from src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs rename to src/ElmSharp/ElmSharp/IAnimatorMotionMapper.cs index 22db0c5..8ed3d37 --- a/src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs +++ b/src/ElmSharp/ElmSharp/IAnimatorMotionMapper.cs @@ -7,23 +7,23 @@ namespace ElmSharp /// /// The AnimatorMotionMapper interface /// - public interface AnimatorMotionMapper + public interface IAnimatorMotionMapper { /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - double Caculate(double position); + double Calculate(double position); } /// /// The LinearMotionMapper class /// - public class LinearMotionMapper : AnimatorMotionMapper + public class LinearMotionMapper : IAnimatorMotionMapper { /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Linear, 0, 0); } @@ -32,12 +32,12 @@ namespace ElmSharp /// /// The AccelerateMotionMapper class /// - public class AccelerateMotionMapper : AnimatorMotionMapper + public class AccelerateMotionMapper : IAnimatorMotionMapper { /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Accelerate, 0, 0); } @@ -46,12 +46,12 @@ namespace ElmSharp /// /// The DecelerateMotionMapper class /// - public class DecelerateMotionMapper : AnimatorMotionMapper + public class DecelerateMotionMapper : IAnimatorMotionMapper { /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Decelerate, 0, 0); } @@ -60,12 +60,12 @@ namespace ElmSharp /// /// The SinusoidalMotionMapper class /// - public class SinusoidalMotionMapper : AnimatorMotionMapper + public class SinusoidalMotionMapper : IAnimatorMotionMapper { /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Sinusoidal, 0, 0); } @@ -74,7 +74,7 @@ namespace ElmSharp /// /// The AccelerateFactorMotionMapper class /// - public class AccelerateFactorMotionMapper : AnimatorMotionMapper + public class AccelerateFactorMotionMapper : IAnimatorMotionMapper { /// /// The power factor of AccelerateFactorMotionMapper @@ -84,7 +84,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.AccelerateFactor, PowerFactor, 0); } @@ -93,7 +93,7 @@ namespace ElmSharp /// /// The DecelerateFactorMotionMapper class /// - public class DecelerateFactorMotionMapper : AnimatorMotionMapper + public class DecelerateFactorMotionMapper : IAnimatorMotionMapper { /// /// The power factor of DecelerateFactorMotionMapper @@ -103,7 +103,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DecelerateFactor, PowerFactor, 0); } @@ -112,7 +112,7 @@ namespace ElmSharp /// /// The SinusoidalFactorMotionMapper class /// - public class SinusoidalFactorMotionMapper : AnimatorMotionMapper + public class SinusoidalFactorMotionMapper : IAnimatorMotionMapper { /// /// The power factor of SinusoidalFactorMotionMapper @@ -122,7 +122,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.SinusoidalFactor, PowerFactor, 0); } @@ -131,7 +131,7 @@ namespace ElmSharp /// /// The DivisorInterpolatedMotionMapper class /// - public class DivisorInterpolatedMotionMapper : AnimatorMotionMapper + public class DivisorInterpolatedMotionMapper : IAnimatorMotionMapper { /// /// The Divisor of DivisorInterpolatedMotionMapper @@ -146,7 +146,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DivisorInterp, Divisor, Power); } @@ -155,7 +155,7 @@ namespace ElmSharp /// /// The BounceMotionMapper class /// - public class BounceMotionMapper : AnimatorMotionMapper + public class BounceMotionMapper : IAnimatorMotionMapper { /// /// The bounces of BounceMotionMapper @@ -170,7 +170,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Bounces); } @@ -179,7 +179,7 @@ namespace ElmSharp /// /// The SpringMotionMapper class /// - public class SpringMotionMapper : AnimatorMotionMapper + public class SpringMotionMapper : IAnimatorMotionMapper { /// /// The wobbles of SpringMotionMapper @@ -194,7 +194,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Wobbles); } @@ -203,7 +203,7 @@ namespace ElmSharp /// /// The CubicBezierMotionMapper class /// - public class CubicBezierMotionMapper : AnimatorMotionMapper + public class CubicBezierMotionMapper : IAnimatorMotionMapper { /// /// The X1 of CubicBezierMotionMapper @@ -228,7 +228,7 @@ namespace ElmSharp /// /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve /// - public double Caculate(double position) + public double Calculate(double position) { double[] values = { X1, Y1, X2, Y2 }; return Interop.Ecore.ecore_animator_pos_map_n(position, Interop.Ecore.PositionMap.Bounce, values.Length, values); diff --git a/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs b/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs index e112cbb..6a09caf 100644 --- a/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs +++ b/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs @@ -16,19 +16,19 @@ namespace ElmSharp.Test int X1, Y1, X2, Y2; - Tuple[] mappers = + Tuple[] mappers = { - new Tuple("Linear", new LinearMotionMapper()), - new Tuple("Accelerate", new AccelerateMotionMapper()), - new Tuple("Decelerate", new DecelerateMotionMapper()), - new Tuple("Sinusoida", new SinusoidalMotionMapper()), - new Tuple("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }), - new Tuple("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }), - new Tuple("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }), - new Tuple("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1}) + new Tuple("Linear", new LinearMotionMapper()), + new Tuple("Accelerate", new AccelerateMotionMapper()), + new Tuple("Decelerate", new DecelerateMotionMapper()), + new Tuple("Sinusoida", new SinusoidalMotionMapper()), + new Tuple("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }), + new Tuple("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }), + new Tuple("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }), + new Tuple("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }), + new Tuple("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }), + new Tuple("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }), + new Tuple("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1}) }; int map_index = 0; @@ -77,7 +77,7 @@ namespace ElmSharp.Test void OnTimeline() { - double o = mappers[map_index].Item2.Caculate(timelineAnimator.Position); + double o = mappers[map_index].Item2.Calculate(timelineAnimator.Position); int x = (int)((X2 * o) + (X1 * (1.0 - o))); int y = (int)((Y2 * o) + (Y1 * (1.0 - o))); diff --git a/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs b/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs index 16e023f..0dc3228 100644 --- a/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs +++ b/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs @@ -16,19 +16,19 @@ namespace ElmSharp.Test.Wearable int X1, Y1, X2, Y2; - Tuple[] mappers = + Tuple[] mappers = { - new Tuple("Linear", new LinearMotionMapper()), - new Tuple("Accelerate", new AccelerateMotionMapper()), - new Tuple("Decelerate", new DecelerateMotionMapper()), - new Tuple("Sinusoida", new SinusoidalMotionMapper()), - new Tuple("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }), - new Tuple("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }), - new Tuple("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }), - new Tuple("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1}) + new Tuple("Linear", new LinearMotionMapper()), + new Tuple("Accelerate", new AccelerateMotionMapper()), + new Tuple("Decelerate", new DecelerateMotionMapper()), + new Tuple("Sinusoida", new SinusoidalMotionMapper()), + new Tuple("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }), + new Tuple("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }), + new Tuple("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }), + new Tuple("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }), + new Tuple("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }), + new Tuple("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }), + new Tuple("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1}) }; int map_index = 0; @@ -77,7 +77,7 @@ namespace ElmSharp.Test.Wearable void OnTimeline() { - double o = mappers[map_index].Item2.Caculate(timelineAnimator.Position); + double o = mappers[map_index].Item2.Calculate(timelineAnimator.Position); int x = (int)((X2 * o) + (X1 * (1.0 - o))); int y = (int)((Y2 * o) + (Y1 * (1.0 - o))); -- 2.7.4