Ejemplo n.º 1
0
 private Plane GetPlaneRotation(MatrixCoordinate tileLocation)
 {
     var plane = new Plane
     {
         PlaneMatrix = _planeTemplate.PlaneMatrix,
         KillPoints = _planeTemplate.KillPoints.ToList()
     };
     var planeRotator = new PlaneRotator();
     switch (_planeOrientation)
     {
         case "up":
             if (tileLocation.Row <= 6 && tileLocation.Column >= 1 && tileLocation.Column <= 8)
             {
                 tileLocation.Column -= 1;
                 BuildPlane(tileLocation, plane);
             }
             break;
         case "down":
             if (tileLocation.Row >= 3 && tileLocation.Column >= 1 && tileLocation.Column <= 8)
             {
                 tileLocation.Column -= 1;
                 tileLocation.Row -= 3;
                 planeRotator.SetPlaneDown(plane);
                 BuildPlane(tileLocation, plane);
             }
             break;
         case "right":
             if (tileLocation.Column >= 3 && tileLocation.Row >= 1 && tileLocation.Row <= 8)
             {
                 tileLocation.Column -= 3;
                 tileLocation.Row -= 1;
                 planeRotator.SetPlaneRight(plane);
                 BuildPlane(tileLocation, plane);
             }
             break;
         case "left":
             if (tileLocation.Column <= 6 && tileLocation.Row >= 1 && tileLocation.Row <= 8)
             {
                 tileLocation.Row -= 1;
                 planeRotator.SetPlaneLeft(plane);
                 BuildPlane(tileLocation, plane);
             }
             break;
     }
     return plane;
 }
Ejemplo n.º 2
0
        private void BuildOponentPlane(MatrixCoordinate startCoordinate, string direction)
        {
            var plane = new Plane();
            var planeRotator = new PlaneRotator();
            switch (direction)
            {
                case "up":

                    break;
                case "down":
                    planeRotator.SetPlaneDown(plane);
                    break;
                case "right":
                    planeRotator.SetPlaneRight(plane);
                    break;
                case "left":
                    planeRotator.SetPlaneLeft(plane);
                    break;
            }
            plane.PlaneStartPosition = startCoordinate;
            BuildDestroyedPlane(plane, false);
        }