Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/type attributes #136

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Feature/type attributes #136

wants to merge 3 commits into from

Conversation

Mwexim
Copy link
Owner

@Mwexim Mwexim commented Feb 14, 2023

Adds a new registration system for types to easily register additional behavior for types, like ranges, default changers, arithmetic, and more. My goal primarily was to provide addon developers with a system to easily bundle attributes together.

Additionally:

  • Reworked ExprDifference and removed its quirky conversion methods. I might add a better conversion system, but probably for the type attributes themselves rather than in the expression class.
  • Reworked ExprRange.
  • Refactored a lot of code, and improved the registration of PropertyConditionals and PropertyExpressions.

This pull request will be completed later with some other additions:

  • A conversion system to easily convert an object to a type with a specific attribute. I will see how I will implement it later.
  • Container attribute for things that contain other things (except lists). Currently only strings contain other strings, but in the Bukkit implementation, inventories act as containers.
  • Comparable attribute, issuing the removal of the Comparator system and moving it to the attribute system.
    After consideration, I decided that type attributes should only be for one type, and not multiple types at once, which the current comparator system supports.
  • NumericalArithmetic with multiply, power, division and other math functions.
  • a getZeroValue() function for the Arithmetic attribute, so it can be used to reset variables for example.

Mwexim added 3 commits February 14, 2023 22:20
# Conflicts:
#	src/main/java/io/github/syst3ms/skriptparser/registration/DefaultRegistration.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant