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.

Start to use seperate `loose_enum` crate.

+272 -419
+120 -176
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]] ··· 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" 380 382 source = "registry+https://github.com/rust-lang/crates.io-index" 381 - checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" 383 + checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 384 + 385 + [[package]] 386 + name = "loose_enum" 387 + version = "0.1.0-beta.1" 388 + dependencies = [ 389 + "num-traits", 390 + "serde_core", 391 + ] 382 392 383 393 [[package]] 384 394 name = "memchr" ··· 413 423 414 424 [[package]] 415 425 name = "parking_lot" 416 - version = "0.12.4" 426 + version = "0.12.5" 417 427 source = "registry+https://github.com/rust-lang/crates.io-index" 418 - checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" 428 + checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" 419 429 dependencies = [ 420 430 "lock_api", 421 431 "parking_lot_core", ··· 423 433 424 434 [[package]] 425 435 name = "parking_lot_core" 426 - version = "0.9.11" 436 + version = "0.9.12" 427 437 source = "registry+https://github.com/rust-lang/crates.io-index" 428 - checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" 438 + checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" 429 439 dependencies = [ 430 440 "cfg-if", 431 441 "libc", 432 442 "redox_syscall", 433 443 "smallvec", 434 - "windows-targets", 444 + "windows-link", 435 445 ] 436 446 437 447 [[package]] ··· 460 470 461 471 [[package]] 462 472 name = "proc-macro2" 463 - version = "1.0.101" 473 + version = "1.0.103" 464 474 source = "registry+https://github.com/rust-lang/crates.io-index" 465 - checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" 475 + checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" 466 476 dependencies = [ 467 477 "unicode-ident", 468 478 ] 469 479 470 480 [[package]] 471 481 name = "quote" 472 - version = "1.0.41" 482 + version = "1.0.42" 473 483 source = "registry+https://github.com/rust-lang/crates.io-index" 474 - checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" 484 + checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 475 485 dependencies = [ 476 486 "proc-macro2", 477 487 ] ··· 523 533 524 534 [[package]] 525 535 name = "redox_syscall" 526 - version = "0.5.17" 536 + version = "0.5.18" 527 537 source = "registry+https://github.com/rust-lang/crates.io-index" 528 - checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" 538 + checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" 529 539 dependencies = [ 530 540 "bitflags", 531 541 ] 532 542 533 543 [[package]] 544 + name = "rustc_version" 545 + version = "0.4.1" 546 + source = "registry+https://github.com/rust-lang/crates.io-index" 547 + checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 548 + dependencies = [ 549 + "semver", 550 + ] 551 + 552 + [[package]] 534 553 name = "rustversion" 535 554 version = "1.0.22" 536 555 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 547 566 version = "1.2.0" 548 567 source = "registry+https://github.com/rust-lang/crates.io-index" 549 568 checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 569 + 570 + [[package]] 571 + name = "semver" 572 + version = "1.0.27" 573 + source = "registry+https://github.com/rust-lang/crates.io-index" 574 + checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" 550 575 551 576 [[package]] 552 577 name = "serde" ··· 623 648 624 649 [[package]] 625 650 name = "syn" 626 - version = "2.0.106" 651 + version = "2.0.111" 627 652 source = "registry+https://github.com/rust-lang/crates.io-index" 628 - checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" 653 + checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" 629 654 dependencies = [ 630 655 "proc-macro2", 631 656 "quote", ··· 654 679 655 680 [[package]] 656 681 name = "toml_datetime" 657 - version = "0.7.2" 682 + version = "0.7.3" 658 683 source = "registry+https://github.com/rust-lang/crates.io-index" 659 - checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" 684 + checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" 660 685 dependencies = [ 661 686 "serde_core", 662 687 ] 663 688 664 689 [[package]] 665 690 name = "toml_edit" 666 - version = "0.23.6" 691 + version = "0.23.9" 667 692 source = "registry+https://github.com/rust-lang/crates.io-index" 668 - checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" 693 + checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" 669 694 dependencies = [ 670 695 "indexmap", 671 696 "toml_datetime", ··· 675 700 676 701 [[package]] 677 702 name = "toml_parser" 678 - version = "1.0.3" 703 + version = "1.0.4" 679 704 source = "registry+https://github.com/rust-lang/crates.io-index" 680 - checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" 705 + checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" 681 706 dependencies = [ 682 707 "winnow", 683 708 ] ··· 690 715 691 716 [[package]] 692 717 name = "unicode-ident" 693 - version = "1.0.19" 718 + version = "1.0.22" 694 719 source = "registry+https://github.com/rust-lang/crates.io-index" 695 - checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" 720 + checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 696 721 697 722 [[package]] 698 723 name = "uuid" 699 - version = "1.18.1" 724 + version = "1.19.0" 700 725 source = "registry+https://github.com/rust-lang/crates.io-index" 701 - checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" 726 + checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" 702 727 dependencies = [ 703 728 "getrandom", 704 729 "js-sys", 705 - "serde", 730 + "serde_core", 706 731 "wasm-bindgen", 707 732 ] 708 733 ··· 718 743 ] 719 744 720 745 [[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 746 name = "wasip2" 731 747 version = "1.0.1+wasi-0.2.4" 732 748 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 737 753 738 754 [[package]] 739 755 name = "wasm-bindgen" 740 - version = "0.2.104" 756 + version = "0.2.106" 741 757 source = "registry+https://github.com/rust-lang/crates.io-index" 742 - checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" 758 + checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" 743 759 dependencies = [ 744 760 "cfg-if", 745 761 "once_cell", ··· 749 765 ] 750 766 751 767 [[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 768 name = "wasm-bindgen-futures" 767 - version = "0.4.54" 769 + version = "0.4.56" 768 770 source = "registry+https://github.com/rust-lang/crates.io-index" 769 - checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" 771 + checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" 770 772 dependencies = [ 771 773 "cfg-if", 772 774 "js-sys", ··· 777 779 778 780 [[package]] 779 781 name = "wasm-bindgen-macro" 780 - version = "0.2.104" 782 + version = "0.2.106" 781 783 source = "registry+https://github.com/rust-lang/crates.io-index" 782 - checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" 784 + checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" 783 785 dependencies = [ 784 786 "quote", 785 787 "wasm-bindgen-macro-support", ··· 787 789 788 790 [[package]] 789 791 name = "wasm-bindgen-macro-support" 790 - version = "0.2.104" 792 + version = "0.2.106" 791 793 source = "registry+https://github.com/rust-lang/crates.io-index" 792 - checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" 794 + checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" 793 795 dependencies = [ 796 + "bumpalo", 794 797 "proc-macro2", 795 798 "quote", 796 799 "syn", 797 - "wasm-bindgen-backend", 798 800 "wasm-bindgen-shared", 799 801 ] 800 802 801 803 [[package]] 802 804 name = "wasm-bindgen-shared" 803 - version = "0.2.104" 805 + version = "0.2.106" 804 806 source = "registry+https://github.com/rust-lang/crates.io-index" 805 - checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" 807 + checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" 806 808 dependencies = [ 807 809 "unicode-ident", 808 810 ] 809 811 810 812 [[package]] 811 813 name = "web-sys" 812 - version = "0.3.81" 814 + version = "0.3.83" 813 815 source = "registry+https://github.com/rust-lang/crates.io-index" 814 - checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" 816 + checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" 815 817 dependencies = [ 816 818 "js-sys", 817 819 "wasm-bindgen", ··· 833 835 ] 834 836 835 837 [[package]] 836 - name = "windows-targets" 837 - version = "0.52.6" 838 - 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" 838 + name = "windows-link" 839 + version = "0.2.1" 878 840 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" 841 + checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 898 842 899 843 [[package]] 900 844 name = "winnow" 901 - version = "0.7.13" 845 + version = "0.7.14" 902 846 source = "registry+https://github.com/rust-lang/crates.io-index" 903 - checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" 847 + checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" 904 848 dependencies = [ 905 849 "memchr", 906 850 ] ··· 913 857 914 858 [[package]] 915 859 name = "zerocopy" 916 - version = "0.8.27" 860 + version = "0.8.31" 917 861 source = "registry+https://github.com/rust-lang/crates.io-index" 918 - checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" 862 + checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" 919 863 dependencies = [ 920 864 "zerocopy-derive", 921 865 ] 922 866 923 867 [[package]] 924 868 name = "zerocopy-derive" 925 - version = "0.8.27" 869 + version = "0.8.31" 926 870 source = "registry+https://github.com/rust-lang/crates.io-index" 927 - checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" 871 + checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" 928 872 dependencies = [ 929 873 "proc-macro2", 930 874 "quote",
+1
Cargo.toml
··· 19 19 ] } 20 20 bevy_reflect = { version = "0.17.0", optional = true, default-features = false } 21 21 indexmap = "2.10.0" 22 + loose_enum = { path = "../loose_enum", 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,
+23 -8
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, ··· 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 loose_enum::LooseBool; 202 217 203 218 #[test] 204 219 fn wave() {
+8 -3
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
+23 -9
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 loose_enum::{LooseBool, loose_enum}; 5 4 use serde::{Deserialize, Serialize}; 6 5 7 6 /// Controls which light IDs are affected by an event. ··· 24 23 pub parameter2: i32, 25 24 /// If true, the filter will start at the end of a group and work backwards. 26 25 #[serde(rename = "r")] 27 - pub reverse: LooseBool, 26 + pub reverse: LooseBool<i32>, 28 27 // V3.1: 29 28 /// > Only present in difficulty file V3.1 or higher. 30 29 /// ··· 208 207 loose_enum! { 209 208 /// Controls how a [`Filter`]'s [`parameter1`](Filter::parameter1) 210 209 /// and [`parameter2`](Filter::parameter2) values are used. 211 - #[derive(Default, Copy)] 212 - FilterType: i32 { 210 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 211 + #[cfg_attr( 212 + feature = "bevy_reflect", 213 + derive(bevy_reflect::Reflect), 214 + reflect(Debug, Clone, PartialEq) 215 + )] 216 + pub enum FilterType: i32 { 213 217 /// Splits the group up into equal sections and selects one. 214 218 /// - [`parameter1`](Filter::parameter1) determines the number of sections. 215 219 /// It will be rounded up to the nearest multiple of the group size. ··· 224 228 } 225 229 226 230 loose_enum!( 227 - #[derive(Default, Copy)] 228 - RandomBehaviour: i32 { 231 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 232 + #[cfg_attr( 233 + feature = "bevy_reflect", 234 + derive(bevy_reflect::Reflect), 235 + reflect(Debug, Clone, PartialEq) 236 + )] 237 + pub enum RandomBehaviour: i32 { 229 238 #[default] 230 239 None = 0, 231 240 KeepOrder = 1, ··· 239 248 /// To see this in practice, check out [this video](https://youtube.com/watch?v=NJPPBvyHJjg&t=338). 240 249 /// 241 250 /// Includes the option to only enable for beat distribution and not value distribution, and vice versa. 242 - #[derive(Default, Copy)] 243 - LimitBehaviour: i32 { 251 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 252 + #[cfg_attr( 253 + feature = "bevy_reflect", 254 + derive(bevy_reflect::Reflect), 255 + reflect(Debug, Clone, PartialEq) 256 + )] 257 + pub enum LimitBehaviour: i32 { 244 258 #[default] 245 259 None = 0, 246 260 Beat = 1,
+18 -8
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::{impl_event_box, impl_event_data, impl_event_group, impl_timed}; 7 + use loose_enum::{LooseBool, loose_enum}; 8 8 use serde::{Deserialize, Serialize}; 9 9 10 10 /// A collection of [`ColorEventGroup`]s that share the same group ID and beat. ··· 65 65 pub bright_dist_value: f32, 66 66 /// Whether the first [`ColorEventData`] of the group will be effected by brightness distribution. 67 67 #[serde(rename = "b")] 68 - pub bright_dist_effect_first: LooseBool, 68 + pub bright_dist_effect_first: LooseBool<i32>, 69 69 /// > Only present in difficulty file V3.2 or higher. 70 70 #[serde(rename = "i")] 71 71 pub bright_dist_easing: Option<Easing>, ··· 140 140 /// 141 141 /// Whether to fade between strobe states or not. 142 142 #[serde(rename = "sf")] 143 - pub strobe_fade: Option<LooseBool>, 143 + pub strobe_fade: Option<LooseBool<i32>>, 144 144 } 145 145 146 146 impl Default for ColorEventData { ··· 161 161 162 162 loose_enum! { 163 163 /// Controls how the state is changed relative to the previous event. 164 - #[derive(Default, Copy)] 165 - ColorTransitionType: i32 { 164 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 165 + #[cfg_attr( 166 + feature = "bevy_reflect", 167 + derive(bevy_reflect::Reflect), 168 + reflect(Debug, Clone, PartialEq) 169 + )] 170 + pub enum ColorTransitionType: i32 { 166 171 /// Unique to color events. 167 172 /// Has the same effect as using [`TransitionType::Transition`](crate::lightshow::TransitionType::Transition) 168 173 /// and [`Easing::None`] in rotation/translation events. ··· 177 182 178 183 loose_enum! { 179 184 /// 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 { 185 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 186 + #[cfg_attr( 187 + feature = "bevy_reflect", 188 + derive(bevy_reflect::Reflect), 189 + reflect(Debug, Clone, PartialEq) 190 + )] 191 + pub enum LightColor: i32 { 182 192 #[default] 183 193 Primary = 0, 184 194 Secondary = 1,
+4 -3
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; 11 10 use crate::{TransitionType, impl_event_box, impl_event_data, impl_event_group, impl_timed}; 12 11 use indexmap::IndexSet; 12 + use loose_enum::LooseBool; 13 13 use ordered_float::OrderedFloat; 14 14 use serde::ser::SerializeStruct; 15 15 use serde::{Deserialize, Deserializer, Serialize, Serializer}; ··· 237 237 /// A value of zero will have no effect. 238 238 pub fx_dist_value: f32, 239 239 /// Whether the first [`FxEventData`] of the group will be effected by brightness distribution. 240 - pub fx_dist_effect_first: LooseBool, 240 + pub fx_dist_effect_first: LooseBool<i32>, 241 241 pub fx_dist_easing: Option<Easing>, 242 242 /// In the actual JSON structure, this is a list of indexes to a separate list of event data. 243 243 /// For consistency, this is merged during parsing. ··· 258 258 #[serde(rename = "s")] 259 259 fx_dist_value: f32, 260 260 #[serde(rename = "b")] 261 - fx_dist_effect_first: LooseBool, 261 + fx_dist_effect_first: LooseBool<i32>, 262 262 #[serde(rename = "i")] 263 263 fx_dist_easing: Option<Easing>, 264 264 #[serde(rename = "l")] ··· 367 367 #[cfg(test)] 368 368 mod tests { 369 369 use super::*; 370 + use loose_enum::LooseBool; 370 371 use serde_json::{Value, json}; 371 372 372 373 fn get_test_container() -> FxEventContainer {
+11 -6
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::{impl_event_box, impl_event_group, impl_timed}; 8 + use loose_enum::{LooseBool, loose_enum}; 9 9 use serde::{Deserialize, Serialize}; 10 10 11 11 /// A collection of [`RotationEventGroup`]s that share the same group ID and beat. ··· 65 65 pub rotation_dist_value: f32, 66 66 /// Whether the first [`RotationEventData`] of the group will be effected by rotation distribution. 67 67 #[serde(rename = "b")] 68 - pub rotation_dist_effect_first: LooseBool, 68 + pub rotation_dist_effect_first: LooseBool<i32>, 69 69 /// > Only present in difficulty file V3.2 or higher. 70 70 #[serde(rename = "i")] 71 71 pub rotation_dist_easing: Option<Easing>, ··· 73 73 pub axis: EventAxis, 74 74 /// If true, the rotation will be mirrored. 75 75 #[serde(rename = "r")] 76 - pub invert_axis: LooseBool, 76 + pub invert_axis: LooseBool<i32>, 77 77 #[serde(rename = "l")] 78 78 pub data: Vec<RotationEventData>, 79 79 } ··· 149 149 loose_enum! { 150 150 /// Determines the direction that the rotation event will rotate. 151 151 /// Automatic will choose the shortest distance. 152 - #[derive(Default, Copy)] 153 - RotationDirection: i32 { 152 + #[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash)] 153 + #[cfg_attr( 154 + feature = "bevy_reflect", 155 + derive(bevy_reflect::Reflect), 156 + reflect(Debug, Clone, PartialEq) 157 + )] 158 + pub enum RotationDirection: i32 { 154 159 #[default] 155 160 Automatic = 0, 156 161 Clockwise = 1,
+3 -3
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; 8 7 use crate::{impl_event_box, impl_event_group, impl_timed}; 8 + use loose_enum::LooseBool; 9 9 use serde::{Deserialize, Serialize}; 10 10 11 11 /// A collection of [`TranslationEventGroup`]s that share the same group ID and beat. ··· 69 69 pub translation_dist_value: f32, 70 70 /// Whether the first [`TranslationEventData`] of the group will be effected by translation distribution. 71 71 #[serde(rename = "b")] 72 - pub translation_dist_effect_first: LooseBool, 72 + pub translation_dist_effect_first: LooseBool<i32>, 73 73 #[serde(rename = "i")] 74 74 pub translation_dist_easing: Easing, 75 75 #[serde(rename = "a")] 76 76 pub axis: EventAxis, 77 77 /// If true, the translation will be mirrored. 78 78 #[serde(rename = "r")] 79 - pub invert_axis: LooseBool, 79 + pub invert_axis: LooseBool<i32>, 80 80 #[serde(rename = "l")] 81 81 pub data: Vec<TranslationEventData>, 82 82 }
+23 -7
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, ··· 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,
-4
src/lib.rs
··· 4 4 pub mod info; 5 5 pub mod timing_traits; 6 6 7 - mod utils; 8 - 9 7 #[doc(hidden)] 10 8 pub use difficulty::*; 11 9 #[doc(hidden)] 12 10 pub use info::*; 13 11 #[doc(hidden)] 14 12 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;
-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 - }