๐ Value Requirement
Available Since 0.0.30
Table of content:
Introduction
The Value Requirement feature introduces a mechanism for retrieving specific values from a requirement, enhancing the flexibility and efficiency of our method handling. This feature aims to address scenarios where it is essential to extract and utilize parameter values from a requirement, such as user authentication details.
Example Usage ๐ฟ
If we want to create an @InGame requirement that will give us Game and GamePlayer we will need to pass RequirementResult.Value with requirement meets as follows
When we want to use it in a command we will do the following thing
In the example above, the method test is defined with annotations indicating it should be executed within the game context The Value Requirement feature will enable you to retrieve specific values related to the Game (Like Game & GamePlayer).
Advantages ๐ก
Reduced Calculation ๐: By directly accessing required values from the
RequirementResult, we minimize the need for additional computations or data retrieval steps.Decreased Code Duplication ๐: This feature eliminates repetitive code patterns by streamlining how values are accessed and utilized within methods.
Increased Simplicity ๐: Simplifies method implementation by allowing direct access to necessary parameter values, improving code readability and maintainability.