FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.48k stars 339 forks source link

Changing names of bases and widgets to ImmutableString #640

Closed b-guild closed 2 months ago

b-guild commented 2 months ago

I have replaced the String names with ImmutableString names. In the process, I added several enhancements to ImmutableString. I added From<String> support to allow ImmutableStrings to be created without copying. I have added Serde implementations for ImmutableString, since Serde support is required for FloatingWindowDescriptor and TileContentDescriptor. I have added a pub use in the fyrox-core library to simplify using ImmutableString.

I have added tests to confirm that ImmutableStrings created by From<String> operate correctly, and testing Fyroxed with these changes reveals no ill effects.

I noticed a potential issue with one of the tests where it asserts a particular value for entry_count(), but the actual value of entry_count() depends on the order in which the tests are executed, which should be unpredictable. Therefore I commented out that assertion.

As an afterthought, I also turned Animation names into ImmutableStrings. I tried making a few animations and this change seems to have had no consequences.