예제 #1
0
    public override void AddCube(GameViewModel viewModel)
    {
        CubeViewModel cubeViewModel = this.CreateViewModel <CubeViewModel> ();

        viewModel.Cubes.Add(cubeViewModel);
        base.AddCube(viewModel);
    }
예제 #2
0
    public void Initialize(GUIHandlers guiHandlersPassed)
    {
        this.cube = this.gameObject.GetComponent <CubeViewModel>();

        this.guiHandlers            = guiHandlersPassed;
        this.guiHandlers.OnRotateX += OnRotateX;
        this.guiHandlers.OnRotateY += OnRotateY;
        this.guiHandlers.OnRotateZ += OnRotateZ;
        this.guiHandlers.OnScaleX  += OnScaleX;
        this.guiHandlers.OnScaleY  += OnScaleY;
        this.guiHandlers.OnScaleZ  += OnScaleZ;

        cachedAngles = cube.transform.rotation.eulerAngles;


        colorList = new List <Color>();

        colorList.Add(Color.red);
        colorList.Add(Color.black);
        colorList.Add(Color.blue);
        colorList.Add(Color.cyan);
        colorList.Add(Color.green);
        colorList.Add(Color.magenta);
        colorList.Add(Color.yellow);
    }
예제 #3
0
 public CubeModel(CubeViewModel viewModel, ICompetitor competitor, int width, int heigth)
     : base(competitor)
 {
     Competitor  = competitor;
     _cubeWidth  = width;
     _cubeHeigth = heigth;
     ViewModel   = viewModel;
     InitiateMovementShadow();
 }
예제 #4
0
    public void Initialize(GUIHandlers guiHandlersPassed)
    {
        this.cube = this.gameObject.GetComponent<CubeViewModel>();

        this.guiHandlers = guiHandlersPassed;
        this.guiHandlers.OnRotateX += OnRotateX;
        this.guiHandlers.OnRotateY += OnRotateY;
        this.guiHandlers.OnRotateZ += OnRotateZ;
        this.guiHandlers.OnScaleX += OnScaleX;
        this.guiHandlers.OnScaleY += OnScaleY;
        this.guiHandlers.OnScaleZ += OnScaleZ;

        cachedAngles = cube.transform.rotation.eulerAngles;

        colorList = new List<Color>();

        colorList.Add(Color.red);
        colorList.Add(Color.black);
        colorList.Add(Color.blue);
        colorList.Add(Color.cyan);
        colorList.Add(Color.green);
        colorList.Add(Color.magenta);
        colorList.Add(Color.yellow);
    }
예제 #5
0
 public override void InitializeCube(CubeViewModel viewModel)
 {
     base.InitializeCube(viewModel);
     // This is called when a CubeViewModel is created
 }
예제 #6
0
 private static Domain.Aggregates.CubeAggregate.Cube CreateCube(CubeViewModel cubeViewModel)
 {
     return(new Domain.Aggregates.CubeAggregate.Cube(
                new Point(cubeViewModel.Width, cubeViewModel.Height, cubeViewModel.Depth),
                cubeViewModel.Coordinates));
 }
예제 #7
0
 public virtual void InitializeCube(CubeViewModel viewModel)
 {
     // This is called when a CubeViewModel is created
     CubeViewModelManager.Add(viewModel);
 }
예제 #8
0
        public MainWindow()
        {
            InitializeComponent();

            var cube = new ThreeByThreeCube();

            cubeViewModel = new CubeViewModel(cube);

            //cube.RotateClockwise(cube.RightFace);   // R
            //cube.RotateClockwise(cube.FrontFace);   // F
            //cube.RotateClockwise(cube.LeftFace);    // L
            //cube.RotateClockwise(cube.LeftFace);    // L
            //cube.RotateClockwise(cube.RightFace);   // R
            //cube.RotateClockwise(cube.FrontFace);   // F
            //cube.RotateClockwise(cube.FrontFace);   // F
            //cube.RotateClockwise(cube.RightFace);   // R
            //cube.RotateClockwise(cube.BackFace);    // B
            //cube.RotateCounterClockwise(cube.BackFace); // B'
            //cube.RotateClockwise(cube.LeftFace);    // L
            //cube.RotateClockwise(cube.FrontFace);   // F
            //cube.RotateCounterClockwise(cube.RightFace); // R'
            //cube.RotateCounterClockwise(cube.LeftFace);    // L'
            //cube.RotateClockwise(cube.TopFace); // U
            //cube.RotateCounterClockwise(cube.RightFace); // R'
            //cube.RotateClockwise(cube.BottomFace); // D
            //cube.RotateCounterClockwise(cube.FrontFace);   // F'
            //cube.RotateCounterClockwise(cube.TopFace); // U'
            //cube.RotateCounterClockwise(cube.FrontFace);   // F'
            //cube.RotateCounterClockwise(cube.TopFace); // U'

            BindFace(frontFace, cubeViewModel.FrontFace);
            BindFace(backFace, cubeViewModel.BackFace);
            BindFace(leftFace, cubeViewModel.LeftFace);
            BindFace(rightFace, cubeViewModel.RightFace);
            BindFace(topFace, cubeViewModel.TopFace);
            BindFace(bottomFace, cubeViewModel.BottomFace);

            //// Solve
            //cubeViewModel.RotateCounterClockwise(cubeViewModel.RightFace); // R'
            //cubeViewModel.RotateClockwise(cubeViewModel.TopFace);     // U
            //cubeViewModel.RotateClockwise(cubeViewModel.LeftFace);    // L
            //cubeViewModel.RotateClockwise(cubeViewModel.LeftFace);    // L
            //cubeViewModel.RotateClockwise(cubeViewModel.TopFace);     // U
            //cubeViewModel.RotateClockwise(cubeViewModel.RightFace);   // R
            //cubeViewModel.RotateClockwise(cubeViewModel.RightFace);   // R
            //cubeViewModel.RotateClockwise(cubeViewModel.FrontFace);   // F
            //cubeViewModel.RotateClockwise(cubeViewModel.BackFace);    // B
            //cubeViewModel.RotateClockwise(cubeViewModel.BackFace);    // B
            //cubeViewModel.RotateCounterClockwise(cubeViewModel.RightFace);    // R'
            //cubeViewModel.RotateCounterClockwise(cubeViewModel.TopFace);      // U'
            //cubeViewModel.RotateCounterClockwise(cubeViewModel.LeftFace);     // L'
            //cubeViewModel.RotateClockwise(cubeViewModel.TopFace);     // U
            //cubeViewModel.RotateClockwise(cubeViewModel.RightFace);   // R
            //cubeViewModel.RotateClockwise(cubeViewModel.RightFace);   // R
            //cubeViewModel.RotateClockwise(cubeViewModel.FrontFace);   // F
            //cubeViewModel.RotateClockwise(cubeViewModel.FrontFace);   // F
            //cubeViewModel.RotateClockwise(cubeViewModel.BottomFace);  // D
            //cubeViewModel.RotateClockwise(cubeViewModel.BackFace);    // B
            //cubeViewModel.RotateClockwise(cubeViewModel.BackFace);    // B
            //cubeViewModel.RotateClockwise(cubeViewModel.BottomFace);  // D
            //cubeViewModel.RotateClockwise(cubeViewModel.BottomFace);  // D
            //cubeViewModel.RotateClockwise(cubeViewModel.BackFace);    // B
            //cubeViewModel.RotateClockwise(cubeViewModel.BackFace);    // B
            //cubeViewModel.RotateCounterClockwise(cubeViewModel.TopFace);  // U'
            //cubeViewModel.RotateClockwise(cubeViewModel.FrontFace);   // F
            //cubeViewModel.RotateClockwise(cubeViewModel.FrontFace);   // F
            //cubeViewModel.RotateClockwise(cubeViewModel.BottomFace);  // D
        }