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 Request: Native Support for Signed Integers #17856

Open
Sceat opened this issue May 21, 2024 · 1 comment
Open

Feature Request: Native Support for Signed Integers #17856

Sceat opened this issue May 21, 2024 · 1 comment
Assignees
Labels
move move-std Move Standard Library or Sui Framework Packages

Comments

@Sceat
Copy link
Contributor

Sceat commented May 21, 2024

Summary

Requesting the addition of native support for signed integers in Sui to facilitate the use of negative numbers within structures.

Motivation

In game development, the ability to use negative numbers within structures is essential. For instance, when creating items, it's often necessary to balance attributes by both increasing and decreasing stats. Native support for signed integers would enable developers to implement these features more effectively and efficiently.

Benefits

  • Enhanced Game Development: Facilitates the creation of balanced game mechanics by allowing attributes to be both positive and negative.
  • Simplified Code: Reduces the need for workarounds and additional logic to handle negative values.
  • Improved Readability: Makes the codebase more intuitive and easier to understand for developers.
image
@stefan-mysten stefan-mysten added move move-std Move Standard Library or Sui Framework Packages labels May 21, 2024
@Sceat
Copy link
Contributor Author

Sceat commented Jun 7, 2024

Additionally, the new Randomness generator would also include signed versions

  • r.generate_s32_in_range(-10, 10)

To allow random stats on crafted items

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move move-std Move Standard Library or Sui Framework Packages
Projects
None yet
Development

No branches or pull requests

7 participants