Ejemplo n.º 1
0
        public RubiksCube()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferMultiSampling = true;
            graphics.PreferredBackBufferWidth = 1920;
            graphics.PreferredBackBufferHeight = 1080;
            graphics.IsFullScreen = true;
            Content.RootDirectory = "Content";

            // Remove the 60 fps limit.
            graphics.SynchronizeWithVerticalRetrace = false;
            this.IsFixedTimeStep = false;

            IsMouseVisible = true;

            cube = new Cube(this, 150);
            Components.Add(cube);

            hud = new HUD(this, cube, graphics, Color.Blue);
            Components.Add(hud);

#if USE_SOLVER
            solver = new Solver(this, cube);
            Components.Add(solver);
#endif

            // Renable the fps limit and windowed mode when debugging.
#if DEBUGGING
            graphics.IsFullScreen = false;

            graphics.SynchronizeWithVerticalRetrace = true;
            this.IsFixedTimeStep = true;
#endif
        }
Ejemplo n.º 2
0
        public HUD(Game game, Cube cube, GraphicsDeviceManager graphics, Color color)
            : base(game)
        {
            this.graphics = graphics;

            this.cube = cube;
            this.color = color;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets all the correct cubies in a list of cubies.
 /// </summary>
 /// <param name="cubies">The list.</param>
 /// <param name="cube">The cube.</param>
 /// <returns>The correct cubies.</returns>
 public static IEnumerable <Cubie> CorrectCubies(this IEnumerable <Cubie> cubies, Cube cube)
 {
     foreach (Cubie c in cubies)
     {
         if (cube.IsCubiePlacedCorrectly(c))
         {
             yield return(c);
         }
     }
 }
Ejemplo n.º 4
0
 public Solver(Game game, Cube cube)
     : base(game)
 {
     this.cube = cube;
 }