Exemple #1
0
 public void DisplayWinner(IWinner winner)
 {
     if (winner != null)
     {
         var currentBitPatterns = _characterToBitMapConverter.GetBitPattern(winner.WinningAttendee.Name, "*** wins ***", winner.AwardedSwag.Company, winner.AwardedSwag.Thing);
         _matrixTransformer = MatrixTransformer.Create<WinnerTransformer>(currentBitPatterns);
         StartTransform(100);
     }
     else
     {
         _matrixTransformer = MatrixTransformer.Create<GameOverTransformer>();
         StartTransform(1000);
     }
 }
Exemple #2
0
 public void DisplayWinner(IWinner winner)
 {
     if (winner != null)
     {
         var currentBitPatterns = _characterToBitMapConverter.GetBitPattern(winner.WinningAttendee.Name, "*** wins ***", winner.AwardedSwag.Company, winner.AwardedSwag.Thing);
         _matrixTransformer = MatrixTransformer.Create <WinnerTransformer>(currentBitPatterns);
         StartTransform(100);
     }
     else
     {
         _matrixTransformer = MatrixTransformer.Create <GameOverTransformer>();
         StartTransform(1000);
     }
 }
        public void Matrix3x3()
        {
            //arrange
            int[,] matrix = new int[3, 3]
            {
                { 0, 1, 2 },
                { 1, 1, 2 },
                { 2, 2, 2 }
            };

            int[,] resultMatrix = new int[2, 2]
            {
                { 1, 2 },
                { 2, 1 }
            };

            //act
            MatrixTransformer matrixTransformer = new MatrixTransformer();

            //assert
            CollectionAssert.AreEqual(matrixTransformer.MatrixCalculate(matrix), resultMatrix);
        }
        public void Matrix3x3RandomValues()
        {
            //arrange
            int[,] matrix = new int[3, 3]
            {
                { 9, 3, 1 },
                { 1, 5, 0 },
                { 7, 2, 6 }
            };

            int[,] resultMatrix = new int[2, 2]
            {
                { 3, 0 },
                { 2, 1 }
            };

            //act
            MatrixTransformer matrixTransformer = new MatrixTransformer();

            //assert
            CollectionAssert.AreEqual(matrixTransformer.MatrixCalculate(matrix), resultMatrix);
        }
        public void Matrix4x4()
        {
            //arrange
            int[,] matrix = new int[4, 4]
            {
                { 0, 1, 2, 3 },
                { 1, 1, 2, 3 },
                { 2, 2, 2, 3 },
                { 3, 3, 3, 3 }
            };

            int[,] resultMatrix = new int[2, 2]
            {
                { 3, 6 },
                { 6, 3 }
            };

            //act
            MatrixTransformer matrixTransformer = new MatrixTransformer();

            //assert
            CollectionAssert.AreEqual(matrixTransformer.MatrixCalculate(matrix), resultMatrix);
        }
Exemple #6
0
 private void GLControl_MouseMove(object sender, MouseEventArgs e)
 {
     if (_BlockEvents)
     {
         return;
     }
     if (_Interface.CurrentScene.Type == SceneType.Scene2D)
     {
         if (this._MouseDown)
         {
             this._CurrentPoint = e.Location;
             float XIntensity = this._CurrentPoint.X - this._OriginalPoint.X;
             float YIntensity = this._CurrentPoint.Y - this._OriginalPoint.Y;
             if (_MouseMoved == null)
             {
                 (_Interface.CurrentScene as Scene2D).Transformation.Translation = new Vertex(this._OriginalTranslation.X + XIntensity, this._OriginalTranslation.Y + YIntensity, 0);
             }
             else
             {
                 Sprite CurrentSprite = _MouseMoved as Sprite;
                 CurrentSprite.Translation = new Vertex(this._OriginalTranslation.X + XIntensity, this._OriginalTranslation.Y + YIntensity, this._OriginalTranslation.Z);
                 _Interface.ForceUpdate(InterfaceUpdateMessage.SceneObjectsUpdated);
             }
         }
     }
     else if (_Interface.CurrentScene.Type == SceneType.Scene3D)
     {
         if (this._MouseDown)
         {
             this._CurrentPoint = e.Location;
             float XIntensity = this._CurrentPoint.X - this._OriginalPoint.X;
             float YIntensity = this._CurrentPoint.Y - this._OriginalPoint.Y;
             (_Interface.CurrentScene as Scene3D).EditorCamera.Rotation    = new Vertex(this._OriginalRotation.X, this._OriginalRotation.Y + XIntensity, this._OriginalRotation.Z);
             (_Interface.CurrentScene as Scene3D).EditorCamera.Translation = MatrixTransformer.TransformVertex(MatrixTransformer.MTRotate(1, XIntensity), this._OriginalTranslation);
         }
     }
 }
        public void Matrix5x5()
        {
            //arrange
            int[,] matrix = new int[5, 5]
            {
                { 0, 1, 2, 3, 4 },
                { 1, 1, 2, 3, 4 },
                { 2, 2, 2, 3, 4 },
                { 3, 3, 3, 3, 4 },
                { 4, 4, 4, 4, 4 }
            };

            int[,] resultMatrix = new int[2, 2]
            {
                { 8, 15 },
                { 15, 8 }
            };

            //act
            MatrixTransformer matrixTransformer = new MatrixTransformer();

            //assert
            CollectionAssert.AreEqual(matrixTransformer.MatrixCalculate(matrix), resultMatrix);
        }
Exemple #8
0
 private void Form_Load(object sender, EventArgs e)
 {
     DisplayCurrentBitPatterns(new BitMatrix());
     _matrixTransformer = MatrixTransformer.Create <StartupTransformer>();
     StartTransform(200);
 }
Exemple #9
0
 public DrawEngine(DrawEngine DE)
 {
     this._Matrix = new MatrixTransformer();
 }
Exemple #10
0
 private void Form_Load(object sender, EventArgs e)
 {
     DisplayCurrentBitPatterns(new BitMatrix());
     _matrixTransformer = MatrixTransformer.Create<StartupTransformer>();
     StartTransform(200);
 }