int Score( PlayerController controller )

book_4_sparkGenerated
code_blocksInput

Description

The Score method in the MoveMode class is responsible for determining the score of a particular movement mode. This score is used to decide which movement mode should be active, with the highest score indicating the preferred mode. The method is virtual, allowing derived classes to provide their own implementation if needed.

Usage

To use the Score method, you need to have an instance of a class that derives from MoveMode. You can then call the method, passing in a PlayerController instance. The method will return an integer representing the score of the movement mode.

Example

public class CustomMoveMode : MoveMode
{
    public override int Score(PlayerController controller)
    {
        // Custom logic to determine the score
        return 10; // Example score
    }
}

// Usage
PlayerController playerController = new PlayerController();
CustomMoveMode customMoveMode = new CustomMoveMode();
int modeScore = customMoveMode.Score(playerController);
// modeScore will be 10 in this example