Constructors

Constructors

  • The constructor function takes in a direction and turning object and sets the direction and turn properties of the Character class.

    Parameters

    • direction: Direction

      The direction parameter is used to specify the current direction of the character. It can be any value that represents a direction, such as "north", "south", "east", or "west".

    • turning: Turning

      The turning parameter is an object that maps each direction to the corresponding turning direction. It is used to determine the new direction when the character turns.

    Returns Character