Beatsaber Rust Utilities: A Beatsaber V3 parsing library.
beatsaber beatmap
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch '0.5.0-release' into get-duration

+380 -430
+122 -177
Cargo.lock
··· 30 30 31 31 [[package]] 32 32 name = "bevy_color" 33 - version = "0.17.0" 33 + version = "0.17.3" 34 34 source = "registry+https://github.com/rust-lang/crates.io-index" 35 - checksum = "8cacbef44641f375a38f9a33e5e52ce7501e4a7cbe57aaebb97755d261bb021d" 35 + checksum = "49504fac6b9897f03b4bdc0189c04ef1ba0a9b37926343aa520a71619e90e116" 36 36 dependencies = [ 37 37 "bevy_math", 38 38 "bevy_reflect", ··· 45 45 46 46 [[package]] 47 47 name = "bevy_macro_utils" 48 - version = "0.17.0" 48 + version = "0.17.3" 49 49 source = "registry+https://github.com/rust-lang/crates.io-index" 50 - checksum = "6217369a5c60e9b23dcdfcb36f2adfc1ec84a67b5bafa79333937a5e0598dda6" 50 + checksum = "62d984f9f8bd0f0d9fb020492a955e641e30e7a425f3588bf346cb3e61fec3c3" 51 51 dependencies = [ 52 52 "parking_lot", 53 53 "proc-macro2", ··· 58 58 59 59 [[package]] 60 60 name = "bevy_math" 61 - version = "0.17.0" 61 + version = "0.17.3" 62 62 source = "registry+https://github.com/rust-lang/crates.io-index" 63 - checksum = "e007ac325ff9e6dc2c60d572d94b17dbbee8ca53f3be16ed06fd1340c1548f0f" 63 + checksum = "5fa74ae5d968749cc073da991757d3c7e3504ac6dbaac5f8c2a54b9d19b0b7ed" 64 64 dependencies = [ 65 65 "approx", 66 66 "bevy_reflect", ··· 77 77 78 78 [[package]] 79 79 name = "bevy_platform" 80 - version = "0.17.0" 80 + version = "0.17.3" 81 81 source = "registry+https://github.com/rust-lang/crates.io-index" 82 - checksum = "c000f9765bfabeb5469a4d6f3577a2d1fc7e0c46309c32b61860143e14f88ee1" 82 + checksum = "4691af6d7cfd1b5deb2fc926a43a180a546cdc3fe1e5a013fcee60db9bb2c81f" 83 83 dependencies = [ 84 84 "critical-section", 85 85 "foldhash", ··· 96 96 97 97 [[package]] 98 98 name = "bevy_ptr" 99 - version = "0.17.0" 99 + version = "0.17.3" 100 100 source = "registry+https://github.com/rust-lang/crates.io-index" 101 - checksum = "66652590ead8412d2b63dd73ff63af61aa5a59e7fc4a5bbe6c799b214cd1dd41" 101 + checksum = "17d24d7906c7de556033168b3485de36c59049fbaef0c2c44c715a23e0329b10" 102 102 103 103 [[package]] 104 104 name = "bevy_reflect" 105 - version = "0.17.0" 105 + version = "0.17.3" 106 106 source = "registry+https://github.com/rust-lang/crates.io-index" 107 - checksum = "0870478f18be825606564bf83919931372947d6a377dd00829812edbe12bb544" 107 + checksum = "b5472b91928c0f3e4e3988c0d036b00719f19520f53a0c3f8c2af72f00e693c5" 108 108 dependencies = [ 109 109 "assert_type_match", 110 110 "bevy_platform", ··· 127 127 128 128 [[package]] 129 129 name = "bevy_reflect_derive" 130 - version = "0.17.0" 130 + version = "0.17.3" 131 131 source = "registry+https://github.com/rust-lang/crates.io-index" 132 - checksum = "8a90e99abc2190b0f8bd80c6e78dcbe4520bebd3be285865720ae3aca515a57f" 132 + checksum = "083784255162fa39960aa3cf3c23af0e515db2daa7f2e796ae34df993f4d3f6c" 133 133 dependencies = [ 134 134 "bevy_macro_utils", 135 135 "indexmap", ··· 141 141 142 142 [[package]] 143 143 name = "bevy_utils" 144 - version = "0.17.0" 144 + version = "0.17.3" 145 145 source = "registry+https://github.com/rust-lang/crates.io-index" 146 - checksum = "31f44ff1544531d9a4948c7e6b93ebdb77840d1da5683a25272d9f526ae62d3d" 146 + checksum = "789d04f88c764877a4552e07745b402dbc45f5d0545e6d102558f2f1752a1d89" 147 147 dependencies = [ 148 148 "bevy_platform", 149 149 "disqualified", ··· 151 151 152 152 [[package]] 153 153 name = "bitflags" 154 - version = "2.9.4" 154 + version = "2.10.0" 155 155 source = "registry+https://github.com/rust-lang/crates.io-index" 156 - checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" 156 + checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 157 157 dependencies = [ 158 - "serde", 158 + "serde_core", 159 159 ] 160 160 161 161 [[package]] 162 162 name = "bsru" 163 - version = "0.4.0" 163 + version = "0.5.0" 164 164 dependencies = [ 165 165 "bevy_color", 166 166 "bevy_reflect", 167 167 "indexmap", 168 + "loose_enum", 168 169 "ordered-float", 169 170 "serde", 170 171 "serde_json", ··· 179 180 180 181 [[package]] 181 182 name = "bytemuck" 182 - version = "1.23.2" 183 + version = "1.24.0" 183 184 source = "registry+https://github.com/rust-lang/crates.io-index" 184 - checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" 185 + checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" 185 186 dependencies = [ 186 187 "bytemuck_derive", 187 188 ] 188 189 189 190 [[package]] 190 191 name = "bytemuck_derive" 191 - version = "1.10.1" 192 + version = "1.10.2" 192 193 source = "registry+https://github.com/rust-lang/crates.io-index" 193 - checksum = "4f154e572231cb6ba2bd1176980827e3d5dc04cc183a75dea38109fbdd672d29" 194 + checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" 194 195 dependencies = [ 195 196 "proc-macro2", 196 197 "quote", ··· 199 200 200 201 [[package]] 201 202 name = "cfg-if" 202 - version = "1.0.3" 203 + version = "1.0.4" 203 204 source = "registry+https://github.com/rust-lang/crates.io-index" 204 - checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" 205 + checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 205 206 206 207 [[package]] 207 208 name = "critical-section" ··· 211 212 212 213 [[package]] 213 214 name = "derive_more" 214 - version = "2.0.1" 215 + version = "2.1.0" 215 216 source = "registry+https://github.com/rust-lang/crates.io-index" 216 - checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" 217 + checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" 217 218 dependencies = [ 218 219 "derive_more-impl", 219 220 ] 220 221 221 222 [[package]] 222 223 name = "derive_more-impl" 223 - version = "2.0.1" 224 + version = "2.1.0" 224 225 source = "registry+https://github.com/rust-lang/crates.io-index" 225 - checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" 226 + checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" 226 227 dependencies = [ 227 228 "proc-macro2", 228 229 "quote", 230 + "rustc_version", 229 231 "syn", 230 232 ] 231 233 ··· 255 257 256 258 [[package]] 257 259 name = "erased-serde" 258 - version = "0.4.8" 260 + version = "0.4.9" 259 261 source = "registry+https://github.com/rust-lang/crates.io-index" 260 - checksum = "259d404d09818dec19332e31d94558aeb442fea04c817006456c24b5460bbd4b" 262 + checksum = "89e8918065695684b2b0702da20382d5ae6065cf3327bc2d6436bd49a71ce9f3" 261 263 dependencies = [ 262 264 "serde", 263 265 "serde_core", ··· 287 289 288 290 [[package]] 289 291 name = "getrandom" 290 - version = "0.3.3" 292 + version = "0.3.4" 291 293 source = "registry+https://github.com/rust-lang/crates.io-index" 292 - checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 294 + checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" 293 295 dependencies = [ 294 296 "cfg-if", 295 297 "libc", 296 298 "r-efi", 297 - "wasi", 299 + "wasip2", 298 300 ] 299 301 300 302 [[package]] 301 303 name = "glam" 302 - version = "0.30.8" 304 + version = "0.30.9" 303 305 source = "registry+https://github.com/rust-lang/crates.io-index" 304 - checksum = "e12d847aeb25f41be4c0ec9587d624e9cd631bc007a8fd7ce3f5851e064c6460" 306 + checksum = "bd47b05dddf0005d850e5644cae7f2b14ac3df487979dbfff3b56f20b1a6ae46" 305 307 dependencies = [ 306 308 "bytemuck", 307 309 "serde_core", ··· 309 311 310 312 [[package]] 311 313 name = "hashbrown" 312 - version = "0.16.0" 314 + version = "0.16.1" 313 315 source = "registry+https://github.com/rust-lang/crates.io-index" 314 - checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" 316 + checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" 315 317 dependencies = [ 316 318 "equivalent", 317 319 "serde", 320 + "serde_core", 318 321 ] 319 322 320 323 [[package]] 321 324 name = "indexmap" 322 - version = "2.11.4" 325 + version = "2.12.1" 323 326 source = "registry+https://github.com/rust-lang/crates.io-index" 324 - checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" 327 + checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" 325 328 dependencies = [ 326 329 "equivalent", 327 330 "hashbrown", ··· 344 347 345 348 [[package]] 346 349 name = "js-sys" 347 - version = "0.3.81" 350 + version = "0.3.83" 348 351 source = "registry+https://github.com/rust-lang/crates.io-index" 349 - checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" 352 + checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" 350 353 dependencies = [ 351 354 "once_cell", 352 355 "wasm-bindgen", ··· 354 357 355 358 [[package]] 356 359 name = "libc" 357 - version = "0.2.176" 360 + version = "0.2.178" 358 361 source = "registry+https://github.com/rust-lang/crates.io-index" 359 - checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" 362 + checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" 360 363 361 364 [[package]] 362 365 name = "libm" ··· 366 369 367 370 [[package]] 368 371 name = "lock_api" 369 - version = "0.4.13" 372 + version = "0.4.14" 370 373 source = "registry+https://github.com/rust-lang/crates.io-index" 371 - checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" 374 + checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" 372 375 dependencies = [ 373 - "autocfg", 374 376 "scopeguard", 375 377 ] 376 378 377 379 [[package]] 378 380 name = "log" 379 - version = "0.4.28" 381 + version = "0.4.29" 382 + source = "registry+https://github.com/rust-lang/crates.io-index" 383 + checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 384 + 385 + [[package]] 386 + name = "loose_enum" 387 + version = "0.1.0" 380 388 source = "registry+https://github.com/rust-lang/crates.io-index" 381 - checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" 389 + checksum = "75aa740f34d6aada4337d4dccc2232686ade9c3944f806e198ddaf1debef167d" 390 + dependencies = [ 391 + "serde_core", 392 + ] 382 393 383 394 [[package]] 384 395 name = "memchr" ··· 413 424 414 425 [[package]] 415 426 name = "parking_lot" 416 - version = "0.12.4" 427 + version = "0.12.5" 417 428 source = "registry+https://github.com/rust-lang/crates.io-index" 418 - checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" 429 + checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" 419 430 dependencies = [ 420 431 "lock_api", 421 432 "parking_lot_core", ··· 423 434 424 435 [[package]] 425 436 name = "parking_lot_core" 426 - version = "0.9.11" 437 + version = "0.9.12" 427 438 source = "registry+https://github.com/rust-lang/crates.io-index" 428 - checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" 439 + checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" 429 440 dependencies = [ 430 441 "cfg-if", 431 442 "libc", 432 443 "redox_syscall", 433 444 "smallvec", 434 - "windows-targets", 445 + "windows-link", 435 446 ] 436 447 437 448 [[package]] ··· 460 471 461 472 [[package]] 462 473 name = "proc-macro2" 463 - version = "1.0.101" 474 + version = "1.0.103" 464 475 source = "registry+https://github.com/rust-lang/crates.io-index" 465 - checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" 476 + checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" 466 477 dependencies = [ 467 478 "unicode-ident", 468 479 ] 469 480 470 481 [[package]] 471 482 name = "quote" 472 - version = "1.0.41" 483 + version = "1.0.42" 473 484 source = "registry+https://github.com/rust-lang/crates.io-index" 474 - checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" 485 + checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 475 486 dependencies = [ 476 487 "proc-macro2", 477 488 ] ··· 523 534 524 535 [[package]] 525 536 name = "redox_syscall" 526 - version = "0.5.17" 537 + version = "0.5.18" 527 538 source = "registry+https://github.com/rust-lang/crates.io-index" 528 - checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" 539 + checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" 529 540 dependencies = [ 530 541 "bitflags", 542 + ] 543 + 544 + [[package]] 545 + name = "rustc_version" 546 + version = "0.4.1" 547 + source = "registry+https://github.com/rust-lang/crates.io-index" 548 + checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 549 + dependencies = [ 550 + "semver", 531 551 ] 532 552 533 553 [[package]] ··· 547 567 version = "1.2.0" 548 568 source = "registry+https://github.com/rust-lang/crates.io-index" 549 569 checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 570 + 571 + [[package]] 572 + name = "semver" 573 + version = "1.0.27" 574 + source = "registry+https://github.com/rust-lang/crates.io-index" 575 + checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" 550 576 551 577 [[package]] 552 578 name = "serde" ··· 623 649 624 650 [[package]] 625 651 name = "syn" 626 - version = "2.0.106" 652 + version = "2.0.111" 627 653 source = "registry+https://github.com/rust-lang/crates.io-index" 628 - checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" 654 + checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" 629 655 dependencies = [ 630 656 "proc-macro2", 631 657 "quote", ··· 654 680 655 681 [[package]] 656 682 name = "toml_datetime" 657 - version = "0.7.2" 683 + version = "0.7.3" 658 684 source = "registry+https://github.com/rust-lang/crates.io-index" 659 - checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" 685 + checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" 660 686 dependencies = [ 661 687 "serde_core", 662 688 ] 663 689 664 690 [[package]] 665 691 name = "toml_edit" 666 - version = "0.23.6" 692 + version = "0.23.9" 667 693 source = "registry+https://github.com/rust-lang/crates.io-index" 668 - checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" 694 + checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" 669 695 dependencies = [ 670 696 "indexmap", 671 697 "toml_datetime", ··· 675 701 676 702 [[package]] 677 703 name = "toml_parser" 678 - version = "1.0.3" 704 + version = "1.0.4" 679 705 source = "registry+https://github.com/rust-lang/crates.io-index" 680 - checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" 706 + checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" 681 707 dependencies = [ 682 708 "winnow", 683 709 ] ··· 690 716 691 717 [[package]] 692 718 name = "unicode-ident" 693 - version = "1.0.19" 719 + version = "1.0.22" 694 720 source = "registry+https://github.com/rust-lang/crates.io-index" 695 - checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" 721 + checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 696 722 697 723 [[package]] 698 724 name = "uuid" 699 - version = "1.18.1" 725 + version = "1.19.0" 700 726 source = "registry+https://github.com/rust-lang/crates.io-index" 701 - checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" 727 + checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" 702 728 dependencies = [ 703 729 "getrandom", 704 730 "js-sys", 705 - "serde", 731 + "serde_core", 706 732 "wasm-bindgen", 707 733 ] 708 734 ··· 718 744 ] 719 745 720 746 [[package]] 721 - name = "wasi" 722 - version = "0.14.7+wasi-0.2.4" 723 - source = "registry+https://github.com/rust-lang/crates.io-index" 724 - checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" 725 - dependencies = [ 726 - "wasip2", 727 - ] 728 - 729 - [[package]] 730 747 name = "wasip2" 731 748 version = "1.0.1+wasi-0.2.4" 732 749 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 737 754 738 755 [[package]] 739 756 name = "wasm-bindgen" 740 - version = "0.2.104" 757 + version = "0.2.106" 741 758 source = "registry+https://github.com/rust-lang/crates.io-index" 742 - checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" 759 + checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" 743 760 dependencies = [ 744 761 "cfg-if", 745 762 "once_cell", ··· 749 766 ] 750 767 751 768 [[package]] 752 - name = "wasm-bindgen-backend" 753 - version = "0.2.104" 754 - source = "registry+https://github.com/rust-lang/crates.io-index" 755 - checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" 756 - dependencies = [ 757 - "bumpalo", 758 - "log", 759 - "proc-macro2", 760 - "quote", 761 - "syn", 762 - "wasm-bindgen-shared", 763 - ] 764 - 765 - [[package]] 766 769 name = "wasm-bindgen-futures" 767 - version = "0.4.54" 770 + version = "0.4.56" 768 771 source = "registry+https://github.com/rust-lang/crates.io-index" 769 - checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" 772 + checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" 770 773 dependencies = [ 771 774 "cfg-if", 772 775 "js-sys", ··· 777 780 778 781 [[package]] 779 782 name = "wasm-bindgen-macro" 780 - version = "0.2.104" 783 + version = "0.2.106" 781 784 source = "registry+https://github.com/rust-lang/crates.io-index" 782 - checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" 785 + checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" 783 786 dependencies = [ 784 787 "quote", 785 788 "wasm-bindgen-macro-support", ··· 787 790 788 791 [[package]] 789 792 name = "wasm-bindgen-macro-support" 790 - version = "0.2.104" 793 + version = "0.2.106" 791 794 source = "registry+https://github.com/rust-lang/crates.io-index" 792 - checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" 795 + checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" 793 796 dependencies = [ 797 + "bumpalo", 794 798 "proc-macro2", 795 799 "quote", 796 800 "syn", 797 - "wasm-bindgen-backend", 798 801 "wasm-bindgen-shared", 799 802 ] 800 803 801 804 [[package]] 802 805 name = "wasm-bindgen-shared" 803 - version = "0.2.104" 806 + version = "0.2.106" 804 807 source = "registry+https://github.com/rust-lang/crates.io-index" 805 - checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" 808 + checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" 806 809 dependencies = [ 807 810 "unicode-ident", 808 811 ] 809 812 810 813 [[package]] 811 814 name = "web-sys" 812 - version = "0.3.81" 815 + version = "0.3.83" 813 816 source = "registry+https://github.com/rust-lang/crates.io-index" 814 - checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" 817 + checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" 815 818 dependencies = [ 816 819 "js-sys", 817 820 "wasm-bindgen", ··· 833 836 ] 834 837 835 838 [[package]] 836 - name = "windows-targets" 837 - version = "0.52.6" 839 + name = "windows-link" 840 + version = "0.2.1" 838 841 source = "registry+https://github.com/rust-lang/crates.io-index" 839 - checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 840 - dependencies = [ 841 - "windows_aarch64_gnullvm", 842 - "windows_aarch64_msvc", 843 - "windows_i686_gnu", 844 - "windows_i686_gnullvm", 845 - "windows_i686_msvc", 846 - "windows_x86_64_gnu", 847 - "windows_x86_64_gnullvm", 848 - "windows_x86_64_msvc", 849 - ] 850 - 851 - [[package]] 852 - name = "windows_aarch64_gnullvm" 853 - version = "0.52.6" 854 - source = "registry+https://github.com/rust-lang/crates.io-index" 855 - checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 856 - 857 - [[package]] 858 - name = "windows_aarch64_msvc" 859 - version = "0.52.6" 860 - source = "registry+https://github.com/rust-lang/crates.io-index" 861 - checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 862 - 863 - [[package]] 864 - name = "windows_i686_gnu" 865 - version = "0.52.6" 866 - source = "registry+https://github.com/rust-lang/crates.io-index" 867 - checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 868 - 869 - [[package]] 870 - name = "windows_i686_gnullvm" 871 - version = "0.52.6" 872 - source = "registry+https://github.com/rust-lang/crates.io-index" 873 - checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 874 - 875 - [[package]] 876 - name = "windows_i686_msvc" 877 - version = "0.52.6" 878 - source = "registry+https://github.com/rust-lang/crates.io-index" 879 - checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 880 - 881 - [[package]] 882 - name = "windows_x86_64_gnu" 883 - version = "0.52.6" 884 - source = "registry+https://github.com/rust-lang/crates.io-index" 885 - checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 886 - 887 - [[package]] 888 - name = "windows_x86_64_gnullvm" 889 - version = "0.52.6" 890 - source = "registry+https://github.com/rust-lang/crates.io-index" 891 - checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 892 - 893 - [[package]] 894 - name = "windows_x86_64_msvc" 895 - version = "0.52.6" 896 - source = "registry+https://github.com/rust-lang/crates.io-index" 897 - checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 842 + checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 898 843 899 844 [[package]] 900 845 name = "winnow" 901 - version = "0.7.13" 846 + version = "0.7.14" 902 847 source = "registry+https://github.com/rust-lang/crates.io-index" 903 - checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" 848 + checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" 904 849 dependencies = [ 905 850 "memchr", 906 851 ] ··· 913 858 914 859 [[package]] 915 860 name = "zerocopy" 916 - version = "0.8.27" 861 + version = "0.8.31" 917 862 source = "registry+https://github.com/rust-lang/crates.io-index" 918 - checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" 863 + checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" 919 864 dependencies = [ 920 865 "zerocopy-derive", 921 866 ] 922 867 923 868 [[package]] 924 869 name = "zerocopy-derive" 925 - version = "0.8.27" 870 + version = "0.8.31" 926 871 source = "registry+https://github.com/rust-lang/crates.io-index" 927 - checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" 872 + checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" 928 873 dependencies = [ 929 874 "proc-macro2", 930 875 "quote",
+2 -1
Cargo.toml
··· 1 1 [package] 2 2 name = "bsru" 3 - version = "0.4.0" 3 + version = "0.5.0" 4 4 edition = "2024" 5 5 description = "Beatsaber Rust Utilities: A Beatsaber V3 parsing library." 6 6 categories = ["game-development", "data-structures", "parser-implementations"] ··· 19 19 ] } 20 20 bevy_reflect = { version = "0.17.0", optional = true, default-features = false } 21 21 indexmap = "2.10.0" 22 + loose_enum = { version = "0.1.0", features = ["serde"] } 22 23 ordered-float = "5.0.0" 23 24 serde = { version = "1.0.219", features = ["derive"] } 24 25 serde_json = "1.0.140"
+9 -3
src/difficulty/gameplay_event.rs
··· 1 1 //! Events that effect gameplay and aren't purely visual. 2 2 3 - use crate::{impl_timed, loose_enum}; 3 + use crate::impl_timed; 4 + use loose_enum::loose_enum; 4 5 use serde::{Deserialize, Serialize}; 5 6 6 7 /// Controls the rotation that interactable objects spawn in 90/360 degree difficulties. ··· 25 26 26 27 loose_enum!( 27 28 /// Determines when a [`LaneRotationEvent`] will be applied to objects. 28 - #[derive(Default, Copy)] 29 - ExecutionTime: i32 { 29 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 30 + #[cfg_attr( 31 + feature = "bevy_reflect", 32 + derive(bevy_reflect::Reflect), 33 + reflect(Debug, Clone, PartialEq) 34 + )] 35 + pub enum ExecutionTime: i32 { 30 36 /// The [`LaneRotationEvent`] will affect objects with a beat *greater than or equal to* the event's beat. 31 37 #[default] 32 38 Early = 0,
+24 -9
src/difficulty/lightshow.rs
··· 14 14 #[doc(hidden)] 15 15 pub use group::*; 16 16 17 - use crate::loose_enum; 17 + use loose_enum::loose_enum; 18 18 19 19 loose_enum! { 20 20 /// The way that the distribution value is used. 21 - #[derive(Default, Copy)] 22 - DistributionType: i32 { 21 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 22 + #[cfg_attr( 23 + feature = "bevy_reflect", 24 + derive(bevy_reflect::Reflect), 25 + reflect(Debug, Clone, PartialEq) 26 + )] 27 + pub enum DistributionType: i32 { 23 28 /// The distribution value represents the difference between *the last and first step*. 24 29 #[default] 25 30 Wave = 1, ··· 122 127 fraction * modified_value 123 128 } 124 129 DistributionType::Step => dist_value * filtered_id, 125 - DistributionType::Unknown(_) => 0.0, 130 + DistributionType::Undefined(_) => 0.0, 126 131 } 127 132 } 128 133 ··· 171 176 172 177 loose_enum! { 173 178 /// Controls how the state is changed relative to the previous event. 174 - #[derive(Default, Copy)] 175 - TransitionType: i32 { 179 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 180 + #[cfg_attr( 181 + feature = "bevy_reflect", 182 + derive(bevy_reflect::Reflect), 183 + reflect(Debug, Clone, PartialEq) 184 + )] 185 + pub enum TransitionType: i32 { 176 186 /// The state will blend from the previous event's state, using the events [easing](Easing). 177 187 #[default] 178 188 Transition = 0, ··· 183 193 184 194 loose_enum! { 185 195 /// The axis that a rotation/translation event effects. 186 - #[derive(Default, Copy)] 187 - EventAxis: i32 { 196 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 197 + #[cfg_attr( 198 + feature = "bevy_reflect", 199 + derive(bevy_reflect::Reflect), 200 + reflect(Debug, Clone, PartialEq) 201 + )] 202 + pub enum EventAxis: i32 { 188 203 #[default] 189 204 X = 0, 190 205 Y = 1, ··· 198 213 mod tests { 199 214 use super::*; 200 215 use crate::difficulty::lightshow::filter::FilterType; 201 - use crate::utils::LooseBool; 216 + use crate::loose_bool::LooseBool; 202 217 203 218 #[test] 204 219 fn wave() {
+10 -5
src/difficulty/lightshow/easing.rs
··· 1 1 //! The easing that a [transition](crate::lightshow::TransitionType::Transition) event will use. 2 2 3 - use crate::loose_enum; 3 + use loose_enum::loose_enum; 4 4 use simple_easing::*; 5 5 6 6 loose_enum! { 7 7 /// The easing that a [transition](crate::lightshow::TransitionType::Transition) event will use. 8 - #[derive(Default, Copy)] 9 - Easing: i32 { 8 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 9 + #[cfg_attr( 10 + feature = "bevy_reflect", 11 + derive(bevy_reflect::Reflect), 12 + reflect(Debug, Clone, PartialEq) 13 + )] 14 + pub enum Easing: i32 { 10 15 #[default] 11 16 None = -1, 12 17 ··· 55 60 /// Applies the relevant easing function. 56 61 /// 57 62 /// The Beatsaber specific easing use the standard equivalent instead. 58 - /// If the easing is [`None`](Self::None) or [`Unknown`](Self::Unknown), then the result will be zero. 63 + /// If the easing is [`None`](Self::None) or [`Undefined`](Self::Undefined), then the result will be zero. 59 64 pub fn ease(&self, num: f32) -> f32 { 60 65 match self { 61 66 Easing::None => 0.0, ··· 95 100 Easing::BeatSaberInOutBack => back_in_out(num), 96 101 Easing::BeatSaberInOutElastic => elastic_in_out(num), 97 102 Easing::BeatSaberInOutBounce => bounce_in_out(num), 98 - Easing::Unknown(_) => 0.0, 103 + Easing::Undefined(_) => 0.0, 99 104 } 100 105 } 101 106 }
+34 -19
src/difficulty/lightshow/filter.rs
··· 1 1 //! Controls which light IDs are affected by an event. 2 2 3 - use crate::loose_enum; 4 - use crate::utils::LooseBool; 3 + use crate::loose_bool::LooseBool; 4 + use loose_enum::loose_enum; 5 5 use serde::{Deserialize, Serialize}; 6 6 7 7 /// Controls which light IDs are affected by an event. ··· 72 72 73 73 impl Filter { 74 74 /// Returns true if the light ID is in the filter. 75 - /// # Unknown 76 - /// If the [`FilterType`] is `Unknown` then the result will be `true`. 75 + /// # Undefined 76 + /// If the [`FilterType`] is `Undefined` then the result will be `true`. 77 77 /// # Panics 78 78 /// Will panic if the light ID is greater than or equal to the group size. 79 79 #[must_use] ··· 111 111 let offset_light_id = light_id - self.parameter1; 112 112 offset_light_id % self.parameter2.max(1) == 0 && offset_light_id >= 0 113 113 } 114 - FilterType::Unknown(_) => true, 114 + FilterType::Undefined(_) => true, 115 115 } 116 116 } 117 117 ··· 120 120 /// This is required for distribution calculations. 121 121 /// 122 122 /// Also see [`count_filtered`](Self::count_filtered). 123 - /// # Unknown 124 - /// If the [`FilterType`] is `Unknown` then the result will be the same as `group_size`. 123 + /// # Undefined 124 + /// If the [`FilterType`] is `Undefined` then the result will be the same as `group_size`. 125 125 #[must_use] 126 126 #[inline] 127 127 #[deprecated(note = "Experimental. Does not consider random in calculations.")] ··· 142 142 FilterType::StepAndOffset => { 143 143 group_size / self.parameter2.max(1) - self.parameter1 / self.parameter2.max(1) 144 144 } 145 - FilterType::Unknown(_) => group_size, 145 + FilterType::Undefined(_) => group_size, 146 146 } 147 147 } 148 148 ··· 150 150 /// Returns the number of light chunks effected by the filter. 151 151 /// 152 152 /// Also see [`count_filtered_without_limit`](Self::count_filtered_without_limit). 153 - /// # Unknown 154 - /// If the [`FilterType`] is `Unknown` then the result will be the same as `group_size`. 153 + /// # Undefined 154 + /// If the [`FilterType`] is `Undefined` then the result will be the same as `group_size`. 155 155 #[must_use] 156 156 #[inline] 157 157 #[deprecated(note = "Experimental. Does not consider random in calculations.")] ··· 168 168 169 169 #[allow(deprecated)] 170 170 /// Returns the light chunk ID relative to the [filtered count](Self::count_filtered). 171 - /// # Unknown 172 - /// If the [`FilterType`] is `Unknown` then the result will be the same as `light_id`. 171 + /// # Undefined 172 + /// If the [`FilterType`] is `Undefined` then the result will be the same as `light_id`. 173 173 /// # Panics 174 174 /// Will panic if the light ID is greater than or equal to the group size. 175 175 // Todo what is the behaviour when the light ID is not in the filter? ··· 200 200 let offset_light_id = light_id - self.parameter1; 201 201 offset_light_id / self.parameter2.max(1) 202 202 } 203 - FilterType::Unknown(_) => group_size, 203 + FilterType::Undefined(_) => group_size, 204 204 } 205 205 } 206 206 } ··· 208 208 loose_enum! { 209 209 /// Controls how a [`Filter`]'s [`parameter1`](Filter::parameter1) 210 210 /// and [`parameter2`](Filter::parameter2) values are used. 211 - #[derive(Default, Copy)] 212 - FilterType: i32 { 211 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 212 + #[cfg_attr( 213 + feature = "bevy_reflect", 214 + derive(bevy_reflect::Reflect), 215 + reflect(Debug, Clone, PartialEq) 216 + )] 217 + pub enum FilterType: i32 { 213 218 /// Splits the group up into equal sections and selects one. 214 219 /// - [`parameter1`](Filter::parameter1) determines the number of sections. 215 220 /// It will be rounded up to the nearest multiple of the group size. ··· 224 229 } 225 230 226 231 loose_enum!( 227 - #[derive(Default, Copy)] 228 - RandomBehaviour: i32 { 232 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 233 + #[cfg_attr( 234 + feature = "bevy_reflect", 235 + derive(bevy_reflect::Reflect), 236 + reflect(Debug, Clone, PartialEq) 237 + )] 238 + pub enum RandomBehaviour: i32 { 229 239 #[default] 230 240 None = 0, 231 241 KeepOrder = 1, ··· 239 249 /// To see this in practice, check out [this video](https://youtube.com/watch?v=NJPPBvyHJjg&t=338). 240 250 /// 241 251 /// Includes the option to only enable for beat distribution and not value distribution, and vice versa. 242 - #[derive(Default, Copy)] 243 - LimitBehaviour: i32 { 252 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 253 + #[cfg_attr( 254 + feature = "bevy_reflect", 255 + derive(bevy_reflect::Reflect), 256 + reflect(Debug, Clone, PartialEq) 257 + )] 258 + pub enum LimitBehaviour: i32 { 244 259 #[default] 245 260 None = 0, 246 261 Beat = 1,
+17 -6
src/difficulty/lightshow/group/color.rs
··· 3 3 use crate::difficulty::lightshow::DistributionType; 4 4 use crate::difficulty::lightshow::easing::Easing; 5 5 use crate::difficulty::lightshow::filter::Filter; 6 - use crate::utils::LooseBool; 7 - use crate::{impl_event_box, impl_event_data, impl_event_group, impl_timed, loose_enum}; 6 + use crate::loose_bool::LooseBool; 7 + use crate::{impl_event_box, impl_event_data, impl_event_group, impl_timed}; 8 + use loose_enum::loose_enum; 8 9 use serde::{Deserialize, Serialize}; 9 10 10 11 /// A collection of [`ColorEventGroup`]s that share the same group ID and beat. ··· 161 162 162 163 loose_enum! { 163 164 /// Controls how the state is changed relative to the previous event. 164 - #[derive(Default, Copy)] 165 - ColorTransitionType: i32 { 165 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 166 + #[cfg_attr( 167 + feature = "bevy_reflect", 168 + derive(bevy_reflect::Reflect), 169 + reflect(Debug, Clone, PartialEq) 170 + )] 171 + pub enum ColorTransitionType: i32 { 166 172 /// Unique to color events. 167 173 /// Has the same effect as using [`TransitionType::Transition`](crate::lightshow::TransitionType::Transition) 168 174 /// and [`Easing::None`] in rotation/translation events. ··· 177 183 178 184 loose_enum! { 179 185 /// Controls which color to display, based on a map or environment's [color scheme](crate::info::color_scheme::ColorScheme). 180 - #[derive(Default, Copy)] 181 - LightColor: i32 { 186 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 187 + #[cfg_attr( 188 + feature = "bevy_reflect", 189 + derive(bevy_reflect::Reflect), 190 + reflect(Debug, Clone, PartialEq) 191 + )] 192 + pub enum LightColor: i32 { 182 193 #[default] 183 194 Primary = 0, 184 195 Secondary = 1,
+2 -1
src/difficulty/lightshow/group/fx.rs
··· 7 7 use crate::difficulty::lightshow::DistributionType; 8 8 use crate::difficulty::lightshow::easing::Easing; 9 9 use crate::difficulty::lightshow::filter::Filter; 10 - use crate::utils::LooseBool; 10 + use crate::loose_bool::LooseBool; 11 11 use crate::{TransitionType, impl_event_box, impl_event_data, impl_event_group, impl_timed}; 12 12 use indexmap::IndexSet; 13 13 use ordered_float::OrderedFloat; ··· 367 367 #[cfg(test)] 368 368 mod tests { 369 369 use super::*; 370 + use crate::loose_bool::LooseBool; 370 371 use serde_json::{Value, json}; 371 372 372 373 fn get_test_container() -> FxEventContainer {
+10 -4
src/difficulty/lightshow/group/rotation.rs
··· 4 4 use crate::difficulty::lightshow::filter::Filter; 5 5 use crate::difficulty::lightshow::group::EventData; 6 6 use crate::difficulty::lightshow::{DistributionType, EventAxis, TransitionType}; 7 - use crate::utils::LooseBool; 8 - use crate::{impl_event_box, impl_event_group, impl_timed, loose_enum}; 7 + use crate::loose_bool::LooseBool; 8 + use crate::{impl_event_box, impl_event_group, impl_timed}; 9 + use loose_enum::loose_enum; 9 10 use serde::{Deserialize, Serialize}; 10 11 11 12 /// A collection of [`RotationEventGroup`]s that share the same group ID and beat. ··· 149 150 loose_enum! { 150 151 /// Determines the direction that the rotation event will rotate. 151 152 /// Automatic will choose the shortest distance. 152 - #[derive(Default, Copy)] 153 - RotationDirection: i32 { 153 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 154 + #[cfg_attr( 155 + feature = "bevy_reflect", 156 + derive(bevy_reflect::Reflect), 157 + reflect(Debug, Clone, PartialEq) 158 + )] 159 + pub enum RotationDirection: i32 { 154 160 #[default] 155 161 Automatic = 0, 156 162 Clockwise = 1,
+1 -1
src/difficulty/lightshow/group/translation.rs
··· 4 4 use crate::difficulty::lightshow::filter::Filter; 5 5 use crate::difficulty::lightshow::group::EventData; 6 6 use crate::difficulty::lightshow::{DistributionType, EventAxis, TransitionType}; 7 - use crate::utils::LooseBool; 7 + use crate::loose_bool::LooseBool; 8 8 use crate::{impl_event_box, impl_event_group, impl_timed}; 9 9 use serde::{Deserialize, Serialize}; 10 10
+25 -9
src/difficulty/playfield.rs
··· 1 1 //! The interactable objects of a difficulty. 2 2 3 - use crate::{impl_duration, impl_timed, loose_enum}; 3 + use crate::{impl_duration, impl_timed}; 4 + use loose_enum::loose_enum; 4 5 use serde::{Deserialize, Serialize}; 5 6 6 7 /// The standard block/note that a player cuts. ··· 38 39 39 40 loose_enum! { 40 41 /// The color of a note, which determines which saber should be used to cut it. 41 - #[derive(Default, Copy)] 42 - NoteColor: i32 { 42 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 43 + #[cfg_attr( 44 + feature = "bevy_reflect", 45 + derive(bevy_reflect::Reflect), 46 + reflect(Debug, Clone, PartialEq) 47 + )] 48 + pub enum NoteColor: i32 { 43 49 #[default] 44 50 Left = 0, 45 51 Right = 1, ··· 48 54 49 55 loose_enum! { 50 56 /// The direction a note should be cut. 51 - #[derive(Default, Copy)] 52 - CutDirection: i32 { 57 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 58 + #[cfg_attr( 59 + feature = "bevy_reflect", 60 + derive(bevy_reflect::Reflect), 61 + reflect(Debug, Clone, PartialEq) 62 + )] 63 + pub enum CutDirection: i32 { 53 64 #[default] 54 65 Up = 0, 55 66 Down = 1, ··· 67 78 impl CutDirection { 68 79 /// Returns the number of degrees a note is rotated, with zero degrees being a downward note. 69 80 /// 70 - /// Returns zero if the cut direction is unknown/any. 81 + /// Returns zero if the cut direction is undefined/any. 71 82 pub fn get_degrees(&self) -> f32 { 72 83 match self { 73 84 CutDirection::Up => 180.0, ··· 79 90 CutDirection::DownLeft => -45.0, 80 91 CutDirection::DownRight => 45.0, 81 92 CutDirection::Any => 0.0, 82 - CutDirection::Unknown(_) => 0.0, 93 + CutDirection::Undefined(_) => 0.0, 83 94 } 84 95 } 85 96 } ··· 231 242 232 243 loose_enum! { 233 244 /// Controls how an arc curves from its head to its tail. 234 - #[derive(Default, Copy)] 235 - MidAnchorMode: i32 { 245 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 246 + #[cfg_attr( 247 + feature = "bevy_reflect", 248 + derive(bevy_reflect::Reflect), 249 + reflect(Debug, Clone, PartialEq) 250 + )] 251 + pub enum MidAnchorMode: i32 { 236 252 #[default] 237 253 Straight = 0, 238 254 Clockwise = 1,
+29 -9
src/info.rs
··· 4 4 5 5 #[doc(hidden)] 6 6 pub use color_scheme::*; 7 + use loose_enum::loose_enum; 7 8 8 - use crate::loose_enum; 9 9 use serde::{Deserialize, Serialize}; 10 10 11 11 /// A map's `Info.dat` file. ··· 67 67 /// The world that surrounds the player and defines which lights are available. 68 68 /// 69 69 /// For 90/360 degree mode, see [`AllDirectionEnvironment`]. 70 - #[derive(Default)] 71 - Environment: String { 70 + #[derive(Default, Debug, Clone, Eq, PartialEq, Hash)] 71 + #[cfg_attr( 72 + feature = "bevy_reflect", 73 + derive(bevy_reflect::Reflect), 74 + reflect(Debug, Clone, PartialEq) 75 + )] 76 + pub enum Environment: String { 72 77 #[default] 73 78 #[doc(alias = "Default")] 74 79 TheFirst = "DefaultEnvironment", ··· 124 129 /// The world that surrounds the player while playing 90/360 degree mode. 125 130 /// 126 131 /// For standard mode, see [`Environment`]. 127 - #[derive(Default)] 128 - AllDirectionEnvironment: String { 132 + #[derive(Default, Debug, Clone, Eq, PartialEq, Hash)] 133 + #[cfg_attr( 134 + feature = "bevy_reflect", 135 + derive(bevy_reflect::Reflect), 136 + reflect(Debug, Clone, PartialEq) 137 + )] 138 + pub enum AllDirectionEnvironment: String { 129 139 #[default] 130 140 GlassDesert = "GlassDesertEnvironment", 131 141 } ··· 150 160 /// 151 161 /// Note that [`Lawless`](Self::Lawless) and [`Lightshow`](Self::Lightshow) are modded characteristics, 152 162 /// and may cause problems in un-modded versions of the game. 153 - #[derive(Default)] 154 - Characteristic: String { 163 + #[derive(Default, Debug, Clone, Eq, PartialEq, Hash)] 164 + #[cfg_attr( 165 + feature = "bevy_reflect", 166 + derive(bevy_reflect::Reflect), 167 + reflect(Debug, Clone, PartialEq) 168 + )] 169 + pub enum Characteristic: String { 155 170 #[default] 156 171 Standard = "Standard", 157 172 NoArrows = "NoArrows", ··· 202 217 } 203 218 204 219 loose_enum! { 205 - #[derive(Default, Copy)] 206 - DifficultyRank: i32 { 220 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 221 + #[cfg_attr( 222 + feature = "bevy_reflect", 223 + derive(bevy_reflect::Reflect), 224 + reflect(Debug, Clone, PartialEq) 225 + )] 226 + pub enum DifficultyRank: i32 { 207 227 Easy = 1, 208 228 Normal = 3, 209 229 Hard = 5,
+2 -2
src/info/color_scheme/presets.rs
··· 69 69 /// White light colors are not currently supported, and are therefor ignored. 70 70 pub fn get_color_scheme(&self) -> ColorScheme { 71 71 match self { 72 - Environment::Unknown(_) 72 + Environment::Undefined(_) 73 73 | Environment::TheFirst 74 74 | Environment::Triangle 75 75 | Environment::Nice ··· 423 423 rgb!(0.32222217, 0.6111111, 0.75), 424 424 rgb!(0.03844783, 0.62239975, 0.90566039) 425 425 ), 426 - AllDirectionEnvironment::Unknown(_) => ColorScheme::default(), 426 + AllDirectionEnvironment::Undefined(_) => ColorScheme::default(), 427 427 } 428 428 } 429 429 }
+1 -4
src/lib.rs
··· 2 2 3 3 pub mod difficulty; 4 4 pub mod info; 5 + mod loose_bool; 5 6 pub mod timing_traits; 6 - 7 - mod utils; 8 7 9 8 #[doc(hidden)] 10 9 pub use difficulty::*; ··· 12 11 pub use info::*; 13 12 #[doc(hidden)] 14 13 pub use timing_traits::*; 15 - /// An integer repr bool, with 0 being false and 1 being true. Any other value will be saved as `Unknown`. 16 - pub use utils::LooseBool;
+92
src/loose_bool.rs
··· 1 + //! Taken from [this example](https://github.com/AlephCubed/loose_enum/blob/main/examples/loose_bool.rs). 2 + 3 + use core::error::Error; 4 + use core::fmt::{Display, Formatter}; 5 + use loose_enum::loose_enum; 6 + 7 + loose_enum! { 8 + /// An integer repr bool, with 0 being false and 1 being true. Any other value will be saved as Undefined. 9 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 10 + #[cfg_attr( 11 + feature = "bevy_reflect", 12 + derive(bevy_reflect::Reflect), 13 + reflect(Debug, Clone, PartialEq) 14 + )] 15 + pub enum LooseBool: i32 { 16 + /// A falsy value of zero. 17 + #[default] 18 + False = 0, 19 + /// A truthy value of one. 20 + True = 1, 21 + } 22 + } 23 + 24 + impl LooseBool { 25 + /// Returns true if the value is [`True`](Self::True). 26 + pub fn is_true(&self) -> bool { 27 + matches!(self, Self::True) 28 + } 29 + 30 + /// Returns true if the value is [`False`](Self::False). 31 + pub fn is_false(&self) -> bool { 32 + matches!(self, Self::False) 33 + } 34 + } 35 + 36 + impl From<bool> for LooseBool { 37 + fn from(value: bool) -> Self { 38 + match value { 39 + true => Self::True, 40 + false => Self::False, 41 + } 42 + } 43 + } 44 + 45 + impl TryFrom<LooseBool> for bool { 46 + type Error = UndefinedBoolError; 47 + 48 + fn try_from(value: LooseBool) -> Result<Self, Self::Error> { 49 + match value { 50 + LooseBool::False => Ok(false), 51 + LooseBool::True => Ok(true), 52 + LooseBool::Undefined(_) => Err(UndefinedBoolError), 53 + } 54 + } 55 + } 56 + 57 + /// Error returned when attempting to convert a [`LooseBool::Undefined`] into a `bool`. 58 + #[derive(Debug, Eq, PartialEq, Hash)] 59 + pub struct UndefinedBoolError; 60 + 61 + impl Display for UndefinedBoolError { 62 + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { 63 + write!(f, "Cannot convert `LooseBool::Undefined` into `bool`.") 64 + } 65 + } 66 + 67 + impl Error for UndefinedBoolError {} 68 + 69 + #[cfg(test)] 70 + mod tests { 71 + use super::*; 72 + 73 + #[test] 74 + fn loose_to_bool() { 75 + assert_eq!(bool::try_from(LooseBool::True), Ok(true)); 76 + assert_eq!(bool::try_from(LooseBool::False), Ok(false)); 77 + 78 + for i in 2..256 { 79 + assert_eq!( 80 + bool::try_from(LooseBool::Undefined(i)), 81 + Err(UndefinedBoolError), 82 + "Failed for i={i}" 83 + ); 84 + } 85 + } 86 + 87 + #[test] 88 + fn bool_to_loose() { 89 + assert_eq!(LooseBool::from(false), LooseBool::False); 90 + assert_eq!(LooseBool::from(true), LooseBool::True); 91 + } 92 + }
-180
src/utils.rs
··· 1 - /// Defines a repr enum that supports any value. If a value does not match any case, it will be parsed as `Unknown`. 2 - #[macro_export] 3 - #[doc(hidden)] 4 - macro_rules! loose_enum { 5 - // Special case for strings: 6 - ( 7 - $(#[$outer:meta])* 8 - $name:ident: String 9 - { 10 - $( 11 - $(#[$meta:meta])* 12 - $variant:ident = $value:expr 13 - ),+ $(,)? 14 - } 15 - ) => { 16 - #[derive(Debug, Clone, Eq, PartialEq, Hash)] 17 - #[cfg_attr( 18 - feature = "bevy_reflect", 19 - derive(bevy_reflect::Reflect), 20 - reflect(Debug, Clone, PartialEq) 21 - )] 22 - $(#[$outer])* 23 - pub enum $name { 24 - $( 25 - $(#[$meta])* 26 - $variant 27 - ),+, 28 - Unknown(String), 29 - } 30 - 31 - impl<'de> serde::Deserialize<'de> for $name { 32 - fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 33 - where 34 - D: serde::Deserializer<'de>, 35 - { 36 - let val = String::deserialize(deserializer)?; 37 - Ok(match val.as_str() { 38 - $( $value => $name::$variant, )+ 39 - other => $name::Unknown(other.to_string()), 40 - }) 41 - } 42 - } 43 - 44 - impl serde::Serialize for $name { 45 - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 46 - where 47 - S: serde::Serializer, 48 - { 49 - match self { 50 - $( $name::$variant => str::serialize($value, serializer), )+ 51 - $name::Unknown(val) => str::serialize(val, serializer), 52 - } 53 - } 54 - } 55 - 56 - impl From<String> for $name { 57 - fn from(value: String) -> Self { 58 - match value.as_str() { 59 - $( $value => $name::$variant, )+ 60 - other => $name::Unknown(other.to_string()), 61 - } 62 - } 63 - } 64 - 65 - impl From<$name> for String { 66 - fn from(value: $name) -> Self { 67 - match value { 68 - $( $name::$variant => $value.to_string(), )+ 69 - $name::Unknown(val) => val, 70 - } 71 - } 72 - } 73 - }; 74 - // All other types: 75 - ( 76 - $(#[$outer:meta])* 77 - $name:ident: $ty:ident 78 - { 79 - $( 80 - $(#[$meta:meta])* 81 - $variant:ident = $value:expr 82 - ),+ $(,)? 83 - } 84 - ) => { 85 - #[derive(Debug, Clone, Eq, PartialEq, Hash)] 86 - #[cfg_attr( 87 - feature = "bevy_reflect", 88 - derive(bevy_reflect::Reflect), 89 - reflect(Debug, Clone, PartialEq) 90 - )] 91 - $(#[$outer])* 92 - pub enum $name { 93 - $( 94 - $(#[$meta])* 95 - $variant 96 - ),+, 97 - Unknown($ty), 98 - } 99 - 100 - impl<'de> serde::Deserialize<'de> for $name { 101 - fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 102 - where 103 - D: serde::Deserializer<'de>, 104 - { 105 - let val = $ty::deserialize(deserializer)?; 106 - Ok(match val { 107 - $( $value => $name::$variant, )+ 108 - other => $name::Unknown(other), 109 - }) 110 - } 111 - } 112 - 113 - impl serde::Serialize for $name { 114 - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 115 - where 116 - S: serde::Serializer, 117 - { 118 - match self { 119 - $( $name::$variant => $ty::serialize(&$value, serializer), )+ 120 - $name::Unknown(val) => $ty::serialize(val, serializer), 121 - } 122 - } 123 - } 124 - 125 - impl From<$ty> for $name { 126 - fn from(value: $ty) -> Self { 127 - match value { 128 - $( $value => $name::$variant, )+ 129 - other => $name::Unknown(other), 130 - } 131 - } 132 - } 133 - 134 - impl From<$name> for $ty { 135 - fn from(value: $name) -> Self { 136 - match value { 137 - $( $name::$variant => $value, )+ 138 - $name::Unknown(val) => val, 139 - } 140 - } 141 - } 142 - }; 143 - } 144 - 145 - loose_enum! { 146 - /// An integer repr bool, with 0 being false and 1 being true. Any other value will be saved as `Unknown`. 147 - #[derive(Default, Copy)] 148 - LooseBool: i32 { 149 - #[default] 150 - False = 0, 151 - True = 1, 152 - } 153 - } 154 - 155 - impl LooseBool { 156 - pub fn is_true(&self) -> bool { 157 - match self { 158 - LooseBool::False => false, 159 - LooseBool::True => true, 160 - LooseBool::Unknown(_) => false, 161 - } 162 - } 163 - 164 - pub fn is_false(&self) -> bool { 165 - match self { 166 - LooseBool::False => true, 167 - LooseBool::True => false, 168 - LooseBool::Unknown(_) => false, 169 - } 170 - } 171 - } 172 - 173 - impl From<bool> for LooseBool { 174 - fn from(value: bool) -> Self { 175 - match value { 176 - true => Self::True, 177 - false => Self::False, 178 - } 179 - } 180 - }