コード例 #1
0
 public ReversibleCameraToolActions(
     EditorScreen editor,
     CameraMoveCommand moveCommand,
     CameraScaleCommand scaleCommand,
     CameraRotateCommand rotateCommand
     )
 {
     Editor        = editor;
     MoveCommand   = moveCommand;
     ScaleCommand  = scaleCommand;
     RotateCommand = rotateCommand;
 }
コード例 #2
0
        public void FromString_Vector2Command()
        {
            var input    = "CameraMove|0.1|(0,0)|0.2|(1,1)|None";
            var expected = new CameraMoveCommand()
            {
                StartTime  = 0.1f,
                EndTime    = 0.2f,
                Easing     = Enum.Parse <Easing>("None"),
                StartValue = Vector2.Zero,
                EndValue   = Vector2.One,
            };
            var actual = (CameraMoveCommand)S2VXCommand.FromString(input);

            Assert.AreEqual(expected.StartTime, actual.StartTime, FloatingPointTolerance);
            Assert.AreEqual(expected.EndTime, actual.EndTime, FloatingPointTolerance);
            Assert.AreEqual(expected.Easing, actual.Easing);
            Assert.AreEqual(expected.StartValue, actual.StartValue);
            Assert.AreEqual(expected.EndValue, actual.EndValue);
        }