Exemplo n.º 1
0
 private void RotateWall(Wall wall)
 {
     if (wall != null)
     {
         if (!wall.Vertical)
         {
             wall.Rotate(90f);
         }
         else
         {
             wall.Rotate(0f);
         }
         var relativePosition = App.Current.MainWindow.PointToScreen(wall.Center);
         GameHelper.SetCursor((int)relativePosition.X, (int)relativePosition.Y);
     }
 }
Exemplo n.º 2
0
        private Wall CreateWall()
        {
            Wall wall = new Wall(game);

            if (placedStructures.Count > 0)
            {
                var previousWall = placedStructures.Peek() as Wall;
                MoveToPreviousWall(wall, previousWall);
                Point relativePoint = App.Current.MainWindow.PointToScreen(wall.Center);
                GameHelper.SetCursor((int)relativePoint.X, (int)relativePoint.Y);
            }
            else
            {
                wall.MoveToPoint(GetCenterToCursor(wall));
            }
            wall.Model.MouseDown += currentStructure_MouseDown;
            return(wall);
        }