Пример #1
0
 // reset a shape in use
 public void Reset()
 {
     // reset position to base and change state
     ScreenPosition          = BaseScreenPosition;
     CurrentMatrixDimensions = BaseMatrixDimensions;
     ShapeOrigin             = new Vector2(CurrentMatrixDimensions.X * TileSize.X / 2,
                                           CurrentMatrixDimensions.Y * TileSize.Y / 2);
     CurrentMatrix          = BaseMatrix.Clone() as int[][];
     currentRotationIdx     = 0;
     cursorReturnOffset     = Vector2.Zero;
     destinationRotationIdx = 0;
     isFlippedHorizontal    = false;
     isFlippedVertical      = false;
     isFlippingHorizontal   = false;
     isFlippingVertical     = false;
     isFlipMidway           = false;
     isRotatingCW           = false;
     isRotatingCCW          = false;
     isValid           = false;
     isSnapped         = false;
     rotation          = 0f;
     scale             = Vector2.One;
     State             = ShapeState.Waiting;
     alpha             = 0f;
     timeIdle          = 0f;
     isDrawHighlighted = false;
 }
Пример #2
0
        public object Clone()
        {
            Shape shape = new Shape();

            shape.alpha = alpha;
//            shape.AssetName = AssetName;
            shape.BaseMatrix              = (baseMatrix != null ? BaseMatrix.Clone() as int[][] : null);
            shape.BaseMatrixDimensions    = BaseMatrixDimensions;
            shape.BaseOrigin              = BaseOrigin;
            shape.BaseScreenPosition      = BaseScreenPosition;
            shape.CurrentMatrix           = (currentMatrix != null ? CurrentMatrix.Clone() as int[][] : null);
            shape.CurrentMatrixDimensions = CurrentMatrixDimensions;
            shape.currentRotationIdx      = currentRotationIdx;
            shape.CursorReturnOffset      = CursorReturnOffset;
            shape.destinationRotationIdx  = destinationRotationIdx;
            shape.IsDrawHighlighted       = IsDrawHighlighted;
            shape.horizontalFlipScale     = horizontalFlipScale;
            shape.isFlipMidway            = isFlipMidway;
            shape.isFlippedHorizontal     = isFlippedHorizontal;
            shape.isFlippedVertical       = isFlippedVertical;
            shape.isFlippingHorizontal    = isFlippingHorizontal;
            shape.isFlippingVertical      = isFlippingVertical;
            shape.isRotatingCW            = isRotatingCW;
            shape.isRotatingCCW           = isRotatingCCW;
            shape.IsSnapCueOnFlipFinish   = IsSnapCueOnFlipFinish;
            shape.IsSnapCueOnRotateFinish = IsSnapCueOnRotateFinish;
            shape.IsValid            = IsValid;
            shape.Key                = Key;
            shape.MusicCueName       = MusicCueName;
            shape.Name               = Name;
            shape.rotation           = rotation;
            shape.scale              = scale;
            shape.ShapeOrigin        = ShapeOrigin;
            shape.ScreenPosition     = ScreenPosition;
            shape.shapeResetDistance = shapeResetDistance;
            shape.State              = State;
            shape.texture            = Texture;
            shape.textureHL          = TextureHL;
            shape.TextureContentName = TextureContentName;
            shape.TileSize           = TileSize;
            shape.TimeIdle           = TimeIdle;
            shape.transition         = transition;
            shape.verticalFlipScale  = verticalFlipScale;

            return(shape);
        }