Esempio n. 1
0
        public static void ResetCurrentPuzzleShapes(bool invalidOnly, bool isHardReset)
        {
            bool playCue = false;

            Cursor.CursorMode = CursorState.Reset;

            if (SelectedShape != null)
            {
                resetSelectedShape();
                playCue = true;
            }

            foreach (Shape shape in CurrentPuzzleSet.ShapesDict.Values)
            {
                if (shape.State != Shape.ShapeState.Waiting)
                {
                    if (invalidOnly)
                    {
                        if (!shape.IsValid)
                        {
                            CurrentPuzzle.RemoveShape(shape);
                            if (isHardReset)
                            {
                                shape.Reset();
                                //                                shape.State = Shape.ShapeState.Resetting;
                            }
                            else
                            {
                                playCue     = true;
                                shape.State = Shape.ShapeState.TransitionOut;
                            }
                        }
                    }
                    else
                    {
                        CurrentPuzzle.RemoveShape(shape);
                        if (isHardReset)
                        {
                            shape.Reset();
                        }
                        else
                        {
                            playCue     = true;
                            shape.State = Shape.ShapeState.TransitionOut;
                        }
                    }
                }
            }

            if (playCue)
            {
                AudioManager.PlayCue("replaceShape");
            }

            Cursor.CursorMode = CursorState.Free;
        }
Esempio n. 2
0
        public static void ShapeGrabTriggered()
        {
            if (MainScreen.PuzzlePanel.SelectedShapeKey == 0)
            {
                return;
            }

            Shape selectedShape = CurrentPuzzleSet.ShapesDict[MainScreen.PuzzlePanel.SelectedShapeKey];

            switch (selectedShape.State)
            {
            case Shape.ShapeState.Dropped:
                Cursor.CursorMode   = CursorState.Grab;
                SelectedShapeKey    = selectedShape.Key;
                SelectedShape.State = Shape.ShapeState.Selected;
                SelectedShape.CursorReturnOffset = Cursor.ScreenPosition - SelectedShape.Shape00Position;

                Cursor.ScreenPosition = SelectedShape.Shape00Position;
                CurrentPuzzle.RemoveShape(SelectedShape);

                if (SelectedShape.IsSnapped)
                {
                    AudioManager.PlayCue("grabSnapped");
                }
                else
                {
                    AudioManager.PlayCue("grab");
                }
//                    return;
                break;

            case Shape.ShapeState.Waiting:
                Cursor.CursorMode   = CursorState.Grab;
                SelectedShapeKey    = selectedShape.Key;
                SelectedShape.State = Shape.ShapeState.TransitionIn;
                SelectedShape.CursorReturnOffset = SelectedShape.ShapeOrigin;

                Cursor.ScreenPosition = SelectedShape.Shape00Position;

                AudioManager.PlayCue("selectShape");
//                    return;
                break;
            }
        }