Search Results for

    Show / Hide Table of Contents

    Class Rotation

    Manages rotation of blocks

    Inheritance
    System.Object
    Rotation
    Namespace: Tetris
    Assembly: cs.temp.dll.dll
    Syntax
    public class Rotation : MonoBehaviour

    Fields

    FutureRotationAc

    Declaration
    public static readonly List<int> FutureRotationAc
    Field Value
    Type Description
    System.Collections.Generic.List<System.Int32>

    FutureRotationC

    Declaration
    public static readonly List<int> FutureRotationC
    Field Value
    Type Description
    System.Collections.Generic.List<System.Int32>

    KeybindRotateAc

    Declaration
    public static readonly List<string> KeybindRotateAc
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>

    KeybindRotateC

    Declaration
    public static readonly List<string> KeybindRotateC
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>

    RotationOffsetX

    Declaration
    public static float RotationOffsetX
    Field Value
    Type Description
    System.Single

    RotationOffsetY

    Declaration
    public static float RotationOffsetY
    Field Value
    Type Description
    System.Single

    Properties

    RGridCache

    Declaration
    public static int[, ] RGridCache { get; set; }
    Property Value
    Type Description
    System.Int32[,]

    Methods

    CanRotate(Int32, Int32, Int32, Int32, Int32)

    Returns if a block is able to rotate, checks for wall and player collisions

    Declaration
    public static bool CanRotate(int playerId, int fromState, int intoState, int xOffset, int yOffset)
    Parameters
    Type Name Description
    System.Int32 playerId

    player id

    System.Int32 fromState

    from rotation state

    System.Int32 intoState

    into rotation state

    System.Int32 xOffset

    x axis move

    System.Int32 yOffset

    y axis move

    Returns
    Type Description
    System.Boolean

    Rotate(Int32, String, Int32, Int32)

    Rotates the block

    Declaration
    public static void Rotate(int playerId, string direction, int xMove, int yMove)
    Parameters
    Type Name Description
    System.Int32 playerId

    player id

    System.String direction

    direction of rotation

    System.Int32 xMove

    x axis move

    System.Int32 yMove

    y axis move

    RotateAttempt(Int32, Int32, Int32, Int32, Int32, String)

    Attempts a rotation, returns true if successful

    Declaration
    public bool RotateAttempt(int playerId, int fromState, int intoState, int xOffset, int yOffset, string direction)
    Parameters
    Type Name Description
    System.Int32 playerId

    player id

    System.Int32 fromState

    from rotation state

    System.Int32 intoState

    into rotation state

    System.Int32 xOffset

    x axis move

    System.Int32 yOffset

    y axis move

    System.String direction

    direction

    Returns
    Type Description
    System.Boolean
    In This Article
    Back to top © 2022 Ondřej Sakala. All rights reserved.