├── .github └── workflows │ ├── linux.yml │ ├── macos.yml │ └── windows.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── Screenshot.png ├── justfile └── src ├── components ├── building.rs ├── gamecell.rs ├── mod.rs └── unit.rs ├── lib.rs ├── main.rs ├── state └── mod.rs └── types ├── ctrlgroups.rs ├── direction.rs ├── kind.rs ├── map.rs ├── mod.rs ├── mode.rs ├── mouse.rs └── race.rs /.github/workflows/linux.yml: -------------------------------------------------------------------------------- 1 | name: Linux 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Build 17 | run: cargo build --verbose 18 | - name: Run tests 19 | run: cargo test --verbose 20 | -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: Mac 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: macos-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Build 17 | run: cargo build --verbose 18 | - name: Run tests 19 | run: cargo test --verbose 20 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: windows-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Build 17 | run: cargo build --verbose 18 | - name: Run tests 19 | run: cargo test --verbose 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ab_glyph_rasterizer" 5 | version = "0.1.4" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" 8 | 9 | [[package]] 10 | name = "adler" 11 | version = "0.2.3" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" 14 | 15 | [[package]] 16 | name = "adler32" 17 | version = "1.2.0" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" 20 | 21 | [[package]] 22 | name = "aho-corasick" 23 | version = "0.7.15" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" 26 | dependencies = [ 27 | "memchr", 28 | ] 29 | 30 | [[package]] 31 | name = "andrew" 32 | version = "0.2.1" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" 35 | dependencies = [ 36 | "bitflags", 37 | "line_drawing", 38 | "rusttype 0.7.9", 39 | "walkdir", 40 | "xdg", 41 | "xml-rs", 42 | ] 43 | 44 | [[package]] 45 | name = "andrew" 46 | version = "0.3.1" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" 49 | dependencies = [ 50 | "bitflags", 51 | "rusttype 0.9.2", 52 | "walkdir", 53 | "xdg", 54 | "xml-rs", 55 | ] 56 | 57 | [[package]] 58 | name = "android_glue" 59 | version = "0.2.3" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" 62 | 63 | [[package]] 64 | name = "android_log-sys" 65 | version = "0.1.2" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e" 68 | 69 | [[package]] 70 | name = "approx" 71 | version = "0.3.2" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" 74 | dependencies = [ 75 | "num-traits", 76 | ] 77 | 78 | [[package]] 79 | name = "autocfg" 80 | version = "1.0.1" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 83 | 84 | [[package]] 85 | name = "bit-set" 86 | version = "0.5.2" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" 89 | dependencies = [ 90 | "bit-vec", 91 | ] 92 | 93 | [[package]] 94 | name = "bit-vec" 95 | version = "0.6.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3" 98 | 99 | [[package]] 100 | name = "bitflags" 101 | version = "1.2.1" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 104 | 105 | [[package]] 106 | name = "block" 107 | version = "0.1.6" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 110 | 111 | [[package]] 112 | name = "bracket-algorithm-traits" 113 | version = "0.8.1" 114 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 115 | dependencies = [ 116 | "bracket-geometry", 117 | "smallvec", 118 | ] 119 | 120 | [[package]] 121 | name = "bracket-color" 122 | version = "0.8.1" 123 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 124 | dependencies = [ 125 | "byteorder", 126 | "lazy_static", 127 | "parking_lot 0.11.1", 128 | ] 129 | 130 | [[package]] 131 | name = "bracket-geometry" 132 | version = "0.8.1" 133 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 134 | dependencies = [ 135 | "ultraviolet", 136 | ] 137 | 138 | [[package]] 139 | name = "bracket-lib" 140 | version = "0.8.1" 141 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 142 | dependencies = [ 143 | "bracket-algorithm-traits", 144 | "bracket-color", 145 | "bracket-geometry", 146 | "bracket-noise", 147 | "bracket-pathfinding", 148 | "bracket-random", 149 | "bracket-terminal", 150 | ] 151 | 152 | [[package]] 153 | name = "bracket-noise" 154 | version = "0.8.1" 155 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 156 | dependencies = [ 157 | "bracket-random", 158 | ] 159 | 160 | [[package]] 161 | name = "bracket-pathfinding" 162 | version = "0.8.1" 163 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 164 | dependencies = [ 165 | "bracket-algorithm-traits", 166 | "bracket-geometry", 167 | "rayon", 168 | "smallvec", 169 | ] 170 | 171 | [[package]] 172 | name = "bracket-random" 173 | version = "0.8.0" 174 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 175 | dependencies = [ 176 | "lazy_static", 177 | "rand", 178 | "rand_xorshift", 179 | "regex", 180 | ] 181 | 182 | [[package]] 183 | name = "bracket-terminal" 184 | version = "0.8.1" 185 | source = "git+https://github.com/thebracket/bracket-lib#d887e5b03711d87e8760fa1c42cdb1407bd23086" 186 | dependencies = [ 187 | "bracket-color", 188 | "bracket-geometry", 189 | "byteorder", 190 | "console_error_panic_hook", 191 | "crossterm", 192 | "flate2", 193 | "glow", 194 | "glutin", 195 | "image", 196 | "lazy_static", 197 | "object-pool", 198 | "parking_lot 0.11.1", 199 | "rand", 200 | "ultraviolet", 201 | "wasm-bindgen", 202 | "wasm-timer", 203 | "web-sys", 204 | "winit 0.22.2", 205 | "winit 0.23.0", 206 | ] 207 | 208 | [[package]] 209 | name = "bumpalo" 210 | version = "3.4.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 213 | 214 | [[package]] 215 | name = "bytemuck" 216 | version = "1.4.1" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac" 219 | 220 | [[package]] 221 | name = "byteorder" 222 | version = "1.3.4" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 225 | 226 | [[package]] 227 | name = "calloop" 228 | version = "0.4.4" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" 231 | dependencies = [ 232 | "mio 0.6.23", 233 | "mio-extras", 234 | "nix 0.14.1", 235 | ] 236 | 237 | [[package]] 238 | name = "calloop" 239 | version = "0.6.5" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" 242 | dependencies = [ 243 | "log", 244 | "nix 0.18.0", 245 | ] 246 | 247 | [[package]] 248 | name = "cc" 249 | version = "1.0.65" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" 252 | 253 | [[package]] 254 | name = "cfg-if" 255 | version = "0.1.10" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 258 | 259 | [[package]] 260 | name = "cfg-if" 261 | version = "1.0.0" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 264 | 265 | [[package]] 266 | name = "cgl" 267 | version = "0.3.2" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" 270 | dependencies = [ 271 | "libc", 272 | ] 273 | 274 | [[package]] 275 | name = "cloudabi" 276 | version = "0.0.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 279 | dependencies = [ 280 | "bitflags", 281 | ] 282 | 283 | [[package]] 284 | name = "cloudabi" 285 | version = "0.1.0" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" 288 | dependencies = [ 289 | "bitflags", 290 | ] 291 | 292 | [[package]] 293 | name = "cocoa" 294 | version = "0.20.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" 297 | dependencies = [ 298 | "bitflags", 299 | "block", 300 | "core-foundation 0.7.0", 301 | "core-graphics 0.19.2", 302 | "foreign-types", 303 | "libc", 304 | "objc", 305 | ] 306 | 307 | [[package]] 308 | name = "cocoa" 309 | version = "0.23.0" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "c54201c07dcf3a5ca33fececb8042aed767ee4bfd5a0235a8ceabcda956044b2" 312 | dependencies = [ 313 | "bitflags", 314 | "block", 315 | "cocoa-foundation", 316 | "core-foundation 0.9.1", 317 | "core-graphics 0.22.1", 318 | "foreign-types", 319 | "libc", 320 | "objc", 321 | ] 322 | 323 | [[package]] 324 | name = "cocoa-foundation" 325 | version = "0.1.0" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" 328 | dependencies = [ 329 | "bitflags", 330 | "block", 331 | "core-foundation 0.9.1", 332 | "core-graphics-types", 333 | "foreign-types", 334 | "libc", 335 | "objc", 336 | ] 337 | 338 | [[package]] 339 | name = "color_quant" 340 | version = "1.1.0" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 343 | 344 | [[package]] 345 | name = "console_error_panic_hook" 346 | version = "0.1.6" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" 349 | dependencies = [ 350 | "cfg-if 0.1.10", 351 | "wasm-bindgen", 352 | ] 353 | 354 | [[package]] 355 | name = "const_fn" 356 | version = "0.4.3" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" 359 | 360 | [[package]] 361 | name = "core-foundation" 362 | version = "0.7.0" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 365 | dependencies = [ 366 | "core-foundation-sys 0.7.0", 367 | "libc", 368 | ] 369 | 370 | [[package]] 371 | name = "core-foundation" 372 | version = "0.9.1" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 375 | dependencies = [ 376 | "core-foundation-sys 0.8.2", 377 | "libc", 378 | ] 379 | 380 | [[package]] 381 | name = "core-foundation-sys" 382 | version = "0.7.0" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 385 | 386 | [[package]] 387 | name = "core-foundation-sys" 388 | version = "0.8.2" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 391 | 392 | [[package]] 393 | name = "core-graphics" 394 | version = "0.19.2" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" 397 | dependencies = [ 398 | "bitflags", 399 | "core-foundation 0.7.0", 400 | "foreign-types", 401 | "libc", 402 | ] 403 | 404 | [[package]] 405 | name = "core-graphics" 406 | version = "0.22.1" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "fc239bba52bab96649441699533a68de294a101533b0270b2d65aa402b29a7f9" 409 | dependencies = [ 410 | "bitflags", 411 | "core-foundation 0.9.1", 412 | "core-graphics-types", 413 | "foreign-types", 414 | "libc", 415 | ] 416 | 417 | [[package]] 418 | name = "core-graphics-types" 419 | version = "0.1.1" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" 422 | dependencies = [ 423 | "bitflags", 424 | "core-foundation 0.9.1", 425 | "foreign-types", 426 | "libc", 427 | ] 428 | 429 | [[package]] 430 | name = "core-video-sys" 431 | version = "0.1.4" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" 434 | dependencies = [ 435 | "cfg-if 0.1.10", 436 | "core-foundation-sys 0.7.0", 437 | "core-graphics 0.19.2", 438 | "libc", 439 | "objc", 440 | ] 441 | 442 | [[package]] 443 | name = "crc32fast" 444 | version = "1.2.1" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" 447 | dependencies = [ 448 | "cfg-if 1.0.0", 449 | ] 450 | 451 | [[package]] 452 | name = "crossbeam-channel" 453 | version = "0.4.4" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" 456 | dependencies = [ 457 | "crossbeam-utils 0.7.2", 458 | "maybe-uninit", 459 | ] 460 | 461 | [[package]] 462 | name = "crossbeam-channel" 463 | version = "0.5.0" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" 466 | dependencies = [ 467 | "cfg-if 1.0.0", 468 | "crossbeam-utils 0.8.1", 469 | ] 470 | 471 | [[package]] 472 | name = "crossbeam-deque" 473 | version = "0.8.0" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" 476 | dependencies = [ 477 | "cfg-if 1.0.0", 478 | "crossbeam-epoch", 479 | "crossbeam-utils 0.8.1", 480 | ] 481 | 482 | [[package]] 483 | name = "crossbeam-epoch" 484 | version = "0.9.1" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" 487 | dependencies = [ 488 | "cfg-if 1.0.0", 489 | "const_fn", 490 | "crossbeam-utils 0.8.1", 491 | "lazy_static", 492 | "memoffset", 493 | "scopeguard", 494 | ] 495 | 496 | [[package]] 497 | name = "crossbeam-utils" 498 | version = "0.7.2" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 501 | dependencies = [ 502 | "autocfg", 503 | "cfg-if 0.1.10", 504 | "lazy_static", 505 | ] 506 | 507 | [[package]] 508 | name = "crossbeam-utils" 509 | version = "0.8.1" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" 512 | dependencies = [ 513 | "autocfg", 514 | "cfg-if 1.0.0", 515 | "lazy_static", 516 | ] 517 | 518 | [[package]] 519 | name = "crossterm" 520 | version = "0.17.7" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "6f4919d60f26ae233e14233cc39746c8c8bb8cd7b05840ace83604917b51b6c7" 523 | dependencies = [ 524 | "bitflags", 525 | "crossterm_winapi", 526 | "lazy_static", 527 | "libc", 528 | "mio 0.7.6", 529 | "parking_lot 0.10.2", 530 | "signal-hook", 531 | "winapi 0.3.9", 532 | ] 533 | 534 | [[package]] 535 | name = "crossterm_winapi" 536 | version = "0.6.2" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "c2265c3f8e080075d9b6417aa72293fc71662f34b4af2612d8d1b074d29510db" 539 | dependencies = [ 540 | "winapi 0.3.9", 541 | ] 542 | 543 | [[package]] 544 | name = "darling" 545 | version = "0.10.2" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" 548 | dependencies = [ 549 | "darling_core", 550 | "darling_macro", 551 | ] 552 | 553 | [[package]] 554 | name = "darling_core" 555 | version = "0.10.2" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" 558 | dependencies = [ 559 | "fnv", 560 | "ident_case", 561 | "proc-macro2 1.0.24", 562 | "quote 1.0.7", 563 | "strsim", 564 | "syn", 565 | ] 566 | 567 | [[package]] 568 | name = "darling_macro" 569 | version = "0.10.2" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" 572 | dependencies = [ 573 | "darling_core", 574 | "quote 1.0.7", 575 | "syn", 576 | ] 577 | 578 | [[package]] 579 | name = "deflate" 580 | version = "0.8.6" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" 583 | dependencies = [ 584 | "adler32", 585 | "byteorder", 586 | ] 587 | 588 | [[package]] 589 | name = "derivative" 590 | version = "2.1.1" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" 593 | dependencies = [ 594 | "proc-macro2 1.0.24", 595 | "quote 1.0.7", 596 | "syn", 597 | ] 598 | 599 | [[package]] 600 | name = "dispatch" 601 | version = "0.2.0" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" 604 | 605 | [[package]] 606 | name = "dlib" 607 | version = "0.4.2" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" 610 | dependencies = [ 611 | "libloading", 612 | ] 613 | 614 | [[package]] 615 | name = "downcast-rs" 616 | version = "1.2.0" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" 619 | 620 | [[package]] 621 | name = "either" 622 | version = "1.6.1" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 625 | 626 | [[package]] 627 | name = "erased-serde" 628 | version = "0.3.12" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "6ca8b296792113e1500fd935ae487be6e00ce318952a6880555554824d6ebf38" 631 | dependencies = [ 632 | "serde", 633 | ] 634 | 635 | [[package]] 636 | name = "flate2" 637 | version = "1.0.19" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" 640 | dependencies = [ 641 | "cfg-if 1.0.0", 642 | "crc32fast", 643 | "libc", 644 | "miniz_oxide 0.4.3", 645 | ] 646 | 647 | [[package]] 648 | name = "fnv" 649 | version = "1.0.7" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 652 | 653 | [[package]] 654 | name = "foreign-types" 655 | version = "0.3.2" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 658 | dependencies = [ 659 | "foreign-types-shared", 660 | ] 661 | 662 | [[package]] 663 | name = "foreign-types-shared" 664 | version = "0.1.1" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 667 | 668 | [[package]] 669 | name = "fuchsia-zircon" 670 | version = "0.3.3" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 673 | dependencies = [ 674 | "bitflags", 675 | "fuchsia-zircon-sys", 676 | ] 677 | 678 | [[package]] 679 | name = "fuchsia-zircon-sys" 680 | version = "0.3.3" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 683 | 684 | [[package]] 685 | name = "futures" 686 | version = "0.1.30" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" 689 | 690 | [[package]] 691 | name = "getrandom" 692 | version = "0.1.15" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" 695 | dependencies = [ 696 | "cfg-if 0.1.10", 697 | "libc", 698 | "wasi", 699 | "wasm-bindgen", 700 | ] 701 | 702 | [[package]] 703 | name = "gl_generator" 704 | version = "0.13.1" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" 707 | dependencies = [ 708 | "khronos_api", 709 | "log", 710 | "xml-rs", 711 | ] 712 | 713 | [[package]] 714 | name = "gl_generator" 715 | version = "0.14.0" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" 718 | dependencies = [ 719 | "khronos_api", 720 | "log", 721 | "xml-rs", 722 | ] 723 | 724 | [[package]] 725 | name = "glow" 726 | version = "0.4.0" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "31aed196700daf16e1241d819ff4a4855a78ee0cddb051948d50b9213deec82f" 729 | dependencies = [ 730 | "gl_generator 0.13.1", 731 | "js-sys", 732 | "slotmap", 733 | "wasm-bindgen", 734 | "web-sys", 735 | ] 736 | 737 | [[package]] 738 | name = "glutin" 739 | version = "0.25.1" 740 | source = "registry+https://github.com/rust-lang/crates.io-index" 741 | checksum = "d8bae26a39a728b003e9fad473ea89527de0de050143b4df866f18bb154bc86e" 742 | dependencies = [ 743 | "android_glue", 744 | "cgl", 745 | "cocoa 0.23.0", 746 | "core-foundation 0.9.1", 747 | "glutin_egl_sys", 748 | "glutin_emscripten_sys", 749 | "glutin_gles2_sys", 750 | "glutin_glx_sys", 751 | "glutin_wgl_sys", 752 | "lazy_static", 753 | "libloading", 754 | "log", 755 | "objc", 756 | "osmesa-sys", 757 | "parking_lot 0.11.1", 758 | "wayland-client 0.28.2", 759 | "wayland-egl", 760 | "winapi 0.3.9", 761 | "winit 0.23.0", 762 | ] 763 | 764 | [[package]] 765 | name = "glutin_egl_sys" 766 | version = "0.1.5" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" 769 | dependencies = [ 770 | "gl_generator 0.14.0", 771 | "winapi 0.3.9", 772 | ] 773 | 774 | [[package]] 775 | name = "glutin_emscripten_sys" 776 | version = "0.1.1" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" 779 | 780 | [[package]] 781 | name = "glutin_gles2_sys" 782 | version = "0.1.5" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" 785 | dependencies = [ 786 | "gl_generator 0.14.0", 787 | "objc", 788 | ] 789 | 790 | [[package]] 791 | name = "glutin_glx_sys" 792 | version = "0.1.7" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" 795 | dependencies = [ 796 | "gl_generator 0.14.0", 797 | "x11-dl", 798 | ] 799 | 800 | [[package]] 801 | name = "glutin_wgl_sys" 802 | version = "0.1.5" 803 | source = "registry+https://github.com/rust-lang/crates.io-index" 804 | checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" 805 | dependencies = [ 806 | "gl_generator 0.14.0", 807 | ] 808 | 809 | [[package]] 810 | name = "hermit-abi" 811 | version = "0.1.17" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" 814 | dependencies = [ 815 | "libc", 816 | ] 817 | 818 | [[package]] 819 | name = "ident_case" 820 | version = "1.0.1" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 823 | 824 | [[package]] 825 | name = "image" 826 | version = "0.23.12" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5" 829 | dependencies = [ 830 | "bytemuck", 831 | "byteorder", 832 | "color_quant", 833 | "jpeg-decoder", 834 | "num-iter", 835 | "num-rational", 836 | "num-traits", 837 | "png", 838 | ] 839 | 840 | [[package]] 841 | name = "instant" 842 | version = "0.1.9" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" 845 | dependencies = [ 846 | "cfg-if 1.0.0", 847 | "js-sys", 848 | "wasm-bindgen", 849 | "web-sys", 850 | ] 851 | 852 | [[package]] 853 | name = "iovec" 854 | version = "0.1.4" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 857 | dependencies = [ 858 | "libc", 859 | ] 860 | 861 | [[package]] 862 | name = "itertools" 863 | version = "0.9.0" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" 866 | dependencies = [ 867 | "either", 868 | ] 869 | 870 | [[package]] 871 | name = "jni-sys" 872 | version = "0.3.0" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" 875 | 876 | [[package]] 877 | name = "jpeg-decoder" 878 | version = "0.1.20" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "cc797adac5f083b8ff0ca6f6294a999393d76e197c36488e2ef732c4715f6fa3" 881 | dependencies = [ 882 | "byteorder", 883 | ] 884 | 885 | [[package]] 886 | name = "js-sys" 887 | version = "0.3.46" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" 890 | dependencies = [ 891 | "wasm-bindgen", 892 | ] 893 | 894 | [[package]] 895 | name = "kernel32-sys" 896 | version = "0.2.2" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 899 | dependencies = [ 900 | "winapi 0.2.8", 901 | "winapi-build", 902 | ] 903 | 904 | [[package]] 905 | name = "khronos_api" 906 | version = "3.1.0" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" 909 | 910 | [[package]] 911 | name = "lazy_static" 912 | version = "1.4.0" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 915 | 916 | [[package]] 917 | name = "lazycell" 918 | version = "1.3.0" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 921 | 922 | [[package]] 923 | name = "legion" 924 | version = "0.3.1" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "9aa40f1a5f64dfdc1830657e0e7dd2c28087c4e32a2a85fcf63a286c429edefc" 927 | dependencies = [ 928 | "bit-set", 929 | "crossbeam-channel 0.4.4", 930 | "derivative", 931 | "downcast-rs", 932 | "erased-serde", 933 | "itertools", 934 | "legion_codegen", 935 | "parking_lot 0.11.1", 936 | "paste", 937 | "rayon", 938 | "serde", 939 | "smallvec", 940 | "thiserror", 941 | "uuid", 942 | ] 943 | 944 | [[package]] 945 | name = "legion_codegen" 946 | version = "0.3.0" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "c24e58060e656eae6b87f83f14f41080656a930fba7ef299122e40eb8ccd307f" 949 | dependencies = [ 950 | "proc-macro2 1.0.24", 951 | "quote 1.0.7", 952 | "syn", 953 | "thiserror", 954 | ] 955 | 956 | [[package]] 957 | name = "libc" 958 | version = "0.2.80" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" 961 | 962 | [[package]] 963 | name = "libloading" 964 | version = "0.6.5" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "1090080fe06ec2648d0da3881d9453d97e71a45f00eb179af7fdd7e3f686fdb0" 967 | dependencies = [ 968 | "cfg-if 1.0.0", 969 | "winapi 0.3.9", 970 | ] 971 | 972 | [[package]] 973 | name = "line_drawing" 974 | version = "0.7.0" 975 | source = "registry+https://github.com/rust-lang/crates.io-index" 976 | checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" 977 | dependencies = [ 978 | "num-traits", 979 | ] 980 | 981 | [[package]] 982 | name = "lock_api" 983 | version = "0.3.4" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" 986 | dependencies = [ 987 | "scopeguard", 988 | ] 989 | 990 | [[package]] 991 | name = "lock_api" 992 | version = "0.4.2" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" 995 | dependencies = [ 996 | "scopeguard", 997 | ] 998 | 999 | [[package]] 1000 | name = "log" 1001 | version = "0.4.11" 1002 | source = "registry+https://github.com/rust-lang/crates.io-index" 1003 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 1004 | dependencies = [ 1005 | "cfg-if 0.1.10", 1006 | ] 1007 | 1008 | [[package]] 1009 | name = "malloc_buf" 1010 | version = "0.0.6" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 1013 | dependencies = [ 1014 | "libc", 1015 | ] 1016 | 1017 | [[package]] 1018 | name = "maybe-uninit" 1019 | version = "2.0.0" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 1022 | 1023 | [[package]] 1024 | name = "memchr" 1025 | version = "2.3.4" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" 1028 | 1029 | [[package]] 1030 | name = "memmap" 1031 | version = "0.7.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" 1034 | dependencies = [ 1035 | "libc", 1036 | "winapi 0.3.9", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "memoffset" 1041 | version = "0.6.1" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" 1044 | dependencies = [ 1045 | "autocfg", 1046 | ] 1047 | 1048 | [[package]] 1049 | name = "miniz_oxide" 1050 | version = "0.3.7" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" 1053 | dependencies = [ 1054 | "adler32", 1055 | ] 1056 | 1057 | [[package]] 1058 | name = "miniz_oxide" 1059 | version = "0.4.3" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" 1062 | dependencies = [ 1063 | "adler", 1064 | "autocfg", 1065 | ] 1066 | 1067 | [[package]] 1068 | name = "mio" 1069 | version = "0.6.23" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" 1072 | dependencies = [ 1073 | "cfg-if 0.1.10", 1074 | "fuchsia-zircon", 1075 | "fuchsia-zircon-sys", 1076 | "iovec", 1077 | "kernel32-sys", 1078 | "libc", 1079 | "log", 1080 | "miow 0.2.2", 1081 | "net2", 1082 | "slab", 1083 | "winapi 0.2.8", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "mio" 1088 | version = "0.7.6" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "f33bc887064ef1fd66020c9adfc45bb9f33d75a42096c81e7c56c65b75dd1a8b" 1091 | dependencies = [ 1092 | "libc", 1093 | "log", 1094 | "miow 0.3.6", 1095 | "ntapi", 1096 | "winapi 0.3.9", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "mio-extras" 1101 | version = "2.0.6" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" 1104 | dependencies = [ 1105 | "lazycell", 1106 | "log", 1107 | "mio 0.6.23", 1108 | "slab", 1109 | ] 1110 | 1111 | [[package]] 1112 | name = "miow" 1113 | version = "0.2.2" 1114 | source = "registry+https://github.com/rust-lang/crates.io-index" 1115 | checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" 1116 | dependencies = [ 1117 | "kernel32-sys", 1118 | "net2", 1119 | "winapi 0.2.8", 1120 | "ws2_32-sys", 1121 | ] 1122 | 1123 | [[package]] 1124 | name = "miow" 1125 | version = "0.3.6" 1126 | source = "registry+https://github.com/rust-lang/crates.io-index" 1127 | checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" 1128 | dependencies = [ 1129 | "socket2", 1130 | "winapi 0.3.9", 1131 | ] 1132 | 1133 | [[package]] 1134 | name = "ndk" 1135 | version = "0.1.0" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" 1138 | dependencies = [ 1139 | "jni-sys", 1140 | "ndk-sys 0.1.0", 1141 | "num_enum", 1142 | ] 1143 | 1144 | [[package]] 1145 | name = "ndk" 1146 | version = "0.2.1" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" 1149 | dependencies = [ 1150 | "jni-sys", 1151 | "ndk-sys 0.2.1", 1152 | "num_enum", 1153 | "thiserror", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "ndk-glue" 1158 | version = "0.1.0" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "d1730ee2e3de41c3321160a6da815f008c4006d71b095880ea50e17cf52332b8" 1161 | dependencies = [ 1162 | "android_log-sys", 1163 | "lazy_static", 1164 | "libc", 1165 | "log", 1166 | "ndk 0.1.0", 1167 | "ndk-sys 0.1.0", 1168 | ] 1169 | 1170 | [[package]] 1171 | name = "ndk-glue" 1172 | version = "0.2.1" 1173 | source = "registry+https://github.com/rust-lang/crates.io-index" 1174 | checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" 1175 | dependencies = [ 1176 | "lazy_static", 1177 | "libc", 1178 | "log", 1179 | "ndk 0.2.1", 1180 | "ndk-macro", 1181 | "ndk-sys 0.2.1", 1182 | ] 1183 | 1184 | [[package]] 1185 | name = "ndk-macro" 1186 | version = "0.2.0" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" 1189 | dependencies = [ 1190 | "darling", 1191 | "proc-macro-crate", 1192 | "proc-macro2 1.0.24", 1193 | "quote 1.0.7", 1194 | "syn", 1195 | ] 1196 | 1197 | [[package]] 1198 | name = "ndk-sys" 1199 | version = "0.1.0" 1200 | source = "registry+https://github.com/rust-lang/crates.io-index" 1201 | checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" 1202 | 1203 | [[package]] 1204 | name = "ndk-sys" 1205 | version = "0.2.1" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" 1208 | 1209 | [[package]] 1210 | name = "net2" 1211 | version = "0.2.36" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "d7cf75f38f16cb05ea017784dc6dbfd354f76c223dba37701734c4f5a9337d02" 1214 | dependencies = [ 1215 | "cfg-if 0.1.10", 1216 | "libc", 1217 | "winapi 0.3.9", 1218 | ] 1219 | 1220 | [[package]] 1221 | name = "nix" 1222 | version = "0.14.1" 1223 | source = "registry+https://github.com/rust-lang/crates.io-index" 1224 | checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" 1225 | dependencies = [ 1226 | "bitflags", 1227 | "cc", 1228 | "cfg-if 0.1.10", 1229 | "libc", 1230 | "void", 1231 | ] 1232 | 1233 | [[package]] 1234 | name = "nix" 1235 | version = "0.18.0" 1236 | source = "registry+https://github.com/rust-lang/crates.io-index" 1237 | checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" 1238 | dependencies = [ 1239 | "bitflags", 1240 | "cc", 1241 | "cfg-if 0.1.10", 1242 | "libc", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "nom" 1247 | version = "6.0.1" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0" 1250 | dependencies = [ 1251 | "memchr", 1252 | "version_check", 1253 | ] 1254 | 1255 | [[package]] 1256 | name = "ntapi" 1257 | version = "0.3.6" 1258 | source = "registry+https://github.com/rust-lang/crates.io-index" 1259 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 1260 | dependencies = [ 1261 | "winapi 0.3.9", 1262 | ] 1263 | 1264 | [[package]] 1265 | name = "num-integer" 1266 | version = "0.1.44" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 1269 | dependencies = [ 1270 | "autocfg", 1271 | "num-traits", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "num-iter" 1276 | version = "0.1.42" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" 1279 | dependencies = [ 1280 | "autocfg", 1281 | "num-integer", 1282 | "num-traits", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "num-rational" 1287 | version = "0.3.2" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" 1290 | dependencies = [ 1291 | "autocfg", 1292 | "num-integer", 1293 | "num-traits", 1294 | ] 1295 | 1296 | [[package]] 1297 | name = "num-traits" 1298 | version = "0.2.14" 1299 | source = "registry+https://github.com/rust-lang/crates.io-index" 1300 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 1301 | dependencies = [ 1302 | "autocfg", 1303 | ] 1304 | 1305 | [[package]] 1306 | name = "num_cpus" 1307 | version = "1.13.0" 1308 | source = "registry+https://github.com/rust-lang/crates.io-index" 1309 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 1310 | dependencies = [ 1311 | "hermit-abi", 1312 | "libc", 1313 | ] 1314 | 1315 | [[package]] 1316 | name = "num_enum" 1317 | version = "0.4.3" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "ca565a7df06f3d4b485494f25ba05da1435950f4dc263440eda7a6fa9b8e36e4" 1320 | dependencies = [ 1321 | "derivative", 1322 | "num_enum_derive", 1323 | ] 1324 | 1325 | [[package]] 1326 | name = "num_enum_derive" 1327 | version = "0.4.3" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" 1330 | dependencies = [ 1331 | "proc-macro-crate", 1332 | "proc-macro2 1.0.24", 1333 | "quote 1.0.7", 1334 | "syn", 1335 | ] 1336 | 1337 | [[package]] 1338 | name = "objc" 1339 | version = "0.2.7" 1340 | source = "registry+https://github.com/rust-lang/crates.io-index" 1341 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 1342 | dependencies = [ 1343 | "malloc_buf", 1344 | ] 1345 | 1346 | [[package]] 1347 | name = "object-pool" 1348 | version = "0.5.3" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "57280719d7b44758cab397e55d4a1a194d4a62575ceea8c794841742b9636e6c" 1351 | dependencies = [ 1352 | "parking_lot 0.10.2", 1353 | ] 1354 | 1355 | [[package]] 1356 | name = "once_cell" 1357 | version = "1.5.2" 1358 | source = "registry+https://github.com/rust-lang/crates.io-index" 1359 | checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" 1360 | 1361 | [[package]] 1362 | name = "ordered-float" 1363 | version = "1.1.0" 1364 | source = "registry+https://github.com/rust-lang/crates.io-index" 1365 | checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" 1366 | dependencies = [ 1367 | "num-traits", 1368 | ] 1369 | 1370 | [[package]] 1371 | name = "osmesa-sys" 1372 | version = "0.1.2" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" 1375 | dependencies = [ 1376 | "shared_library", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "owned_ttf_parser" 1381 | version = "0.6.0" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" 1384 | dependencies = [ 1385 | "ttf-parser", 1386 | ] 1387 | 1388 | [[package]] 1389 | name = "parking_lot" 1390 | version = "0.10.2" 1391 | source = "registry+https://github.com/rust-lang/crates.io-index" 1392 | checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" 1393 | dependencies = [ 1394 | "lock_api 0.3.4", 1395 | "parking_lot_core 0.7.2", 1396 | ] 1397 | 1398 | [[package]] 1399 | name = "parking_lot" 1400 | version = "0.11.1" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 1403 | dependencies = [ 1404 | "instant", 1405 | "lock_api 0.4.2", 1406 | "parking_lot_core 0.8.0", 1407 | ] 1408 | 1409 | [[package]] 1410 | name = "parking_lot_core" 1411 | version = "0.7.2" 1412 | source = "registry+https://github.com/rust-lang/crates.io-index" 1413 | checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" 1414 | dependencies = [ 1415 | "cfg-if 0.1.10", 1416 | "cloudabi 0.0.3", 1417 | "libc", 1418 | "redox_syscall", 1419 | "smallvec", 1420 | "winapi 0.3.9", 1421 | ] 1422 | 1423 | [[package]] 1424 | name = "parking_lot_core" 1425 | version = "0.8.0" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" 1428 | dependencies = [ 1429 | "cfg-if 0.1.10", 1430 | "cloudabi 0.1.0", 1431 | "instant", 1432 | "libc", 1433 | "redox_syscall", 1434 | "smallvec", 1435 | "winapi 0.3.9", 1436 | ] 1437 | 1438 | [[package]] 1439 | name = "paste" 1440 | version = "1.0.3" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "7151b083b0664ed58ed669fcdd92f01c3d2fdbf10af4931a301474950b52bfa9" 1443 | 1444 | [[package]] 1445 | name = "percent-encoding" 1446 | version = "2.1.0" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1449 | 1450 | [[package]] 1451 | name = "pkg-config" 1452 | version = "0.3.19" 1453 | source = "registry+https://github.com/rust-lang/crates.io-index" 1454 | checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 1455 | 1456 | [[package]] 1457 | name = "png" 1458 | version = "0.16.7" 1459 | source = "registry+https://github.com/rust-lang/crates.io-index" 1460 | checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970" 1461 | dependencies = [ 1462 | "bitflags", 1463 | "crc32fast", 1464 | "deflate", 1465 | "miniz_oxide 0.3.7", 1466 | ] 1467 | 1468 | [[package]] 1469 | name = "ppv-lite86" 1470 | version = "0.2.10" 1471 | source = "registry+https://github.com/rust-lang/crates.io-index" 1472 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 1473 | 1474 | [[package]] 1475 | name = "proc-macro-crate" 1476 | version = "0.1.5" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1479 | dependencies = [ 1480 | "toml", 1481 | ] 1482 | 1483 | [[package]] 1484 | name = "proc-macro2" 1485 | version = "0.4.30" 1486 | source = "registry+https://github.com/rust-lang/crates.io-index" 1487 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 1488 | dependencies = [ 1489 | "unicode-xid 0.1.0", 1490 | ] 1491 | 1492 | [[package]] 1493 | name = "proc-macro2" 1494 | version = "1.0.24" 1495 | source = "registry+https://github.com/rust-lang/crates.io-index" 1496 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 1497 | dependencies = [ 1498 | "unicode-xid 0.2.1", 1499 | ] 1500 | 1501 | [[package]] 1502 | name = "quote" 1503 | version = "0.6.13" 1504 | source = "registry+https://github.com/rust-lang/crates.io-index" 1505 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 1506 | dependencies = [ 1507 | "proc-macro2 0.4.30", 1508 | ] 1509 | 1510 | [[package]] 1511 | name = "quote" 1512 | version = "1.0.7" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 1515 | dependencies = [ 1516 | "proc-macro2 1.0.24", 1517 | ] 1518 | 1519 | [[package]] 1520 | name = "rand" 1521 | version = "0.7.3" 1522 | source = "registry+https://github.com/rust-lang/crates.io-index" 1523 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1524 | dependencies = [ 1525 | "getrandom", 1526 | "libc", 1527 | "rand_chacha", 1528 | "rand_core", 1529 | "rand_hc", 1530 | ] 1531 | 1532 | [[package]] 1533 | name = "rand_chacha" 1534 | version = "0.2.2" 1535 | source = "registry+https://github.com/rust-lang/crates.io-index" 1536 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1537 | dependencies = [ 1538 | "ppv-lite86", 1539 | "rand_core", 1540 | ] 1541 | 1542 | [[package]] 1543 | name = "rand_core" 1544 | version = "0.5.1" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1547 | dependencies = [ 1548 | "getrandom", 1549 | ] 1550 | 1551 | [[package]] 1552 | name = "rand_hc" 1553 | version = "0.2.0" 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" 1555 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1556 | dependencies = [ 1557 | "rand_core", 1558 | ] 1559 | 1560 | [[package]] 1561 | name = "rand_xorshift" 1562 | version = "0.2.0" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" 1565 | dependencies = [ 1566 | "rand_core", 1567 | ] 1568 | 1569 | [[package]] 1570 | name = "raw-window-handle" 1571 | version = "0.3.3" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" 1574 | dependencies = [ 1575 | "libc", 1576 | ] 1577 | 1578 | [[package]] 1579 | name = "rayon" 1580 | version = "1.5.0" 1581 | source = "registry+https://github.com/rust-lang/crates.io-index" 1582 | checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" 1583 | dependencies = [ 1584 | "autocfg", 1585 | "crossbeam-deque", 1586 | "either", 1587 | "rayon-core", 1588 | ] 1589 | 1590 | [[package]] 1591 | name = "rayon-core" 1592 | version = "1.9.0" 1593 | source = "registry+https://github.com/rust-lang/crates.io-index" 1594 | checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" 1595 | dependencies = [ 1596 | "crossbeam-channel 0.5.0", 1597 | "crossbeam-deque", 1598 | "crossbeam-utils 0.8.1", 1599 | "lazy_static", 1600 | "num_cpus", 1601 | ] 1602 | 1603 | [[package]] 1604 | name = "redox_syscall" 1605 | version = "0.1.57" 1606 | source = "registry+https://github.com/rust-lang/crates.io-index" 1607 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 1608 | 1609 | [[package]] 1610 | name = "regex" 1611 | version = "1.4.2" 1612 | source = "registry+https://github.com/rust-lang/crates.io-index" 1613 | checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" 1614 | dependencies = [ 1615 | "aho-corasick", 1616 | "memchr", 1617 | "regex-syntax", 1618 | "thread_local", 1619 | ] 1620 | 1621 | [[package]] 1622 | name = "regex-syntax" 1623 | version = "0.6.21" 1624 | source = "registry+https://github.com/rust-lang/crates.io-index" 1625 | checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" 1626 | 1627 | [[package]] 1628 | name = "rusttype" 1629 | version = "0.7.9" 1630 | source = "registry+https://github.com/rust-lang/crates.io-index" 1631 | checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" 1632 | dependencies = [ 1633 | "rusttype 0.8.3", 1634 | ] 1635 | 1636 | [[package]] 1637 | name = "rusttype" 1638 | version = "0.8.3" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" 1641 | dependencies = [ 1642 | "approx", 1643 | "ordered-float", 1644 | "stb_truetype", 1645 | ] 1646 | 1647 | [[package]] 1648 | name = "rusttype" 1649 | version = "0.9.2" 1650 | source = "registry+https://github.com/rust-lang/crates.io-index" 1651 | checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" 1652 | dependencies = [ 1653 | "ab_glyph_rasterizer", 1654 | "owned_ttf_parser", 1655 | ] 1656 | 1657 | [[package]] 1658 | name = "safe_arch" 1659 | version = "0.5.2" 1660 | source = "registry+https://github.com/rust-lang/crates.io-index" 1661 | checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" 1662 | dependencies = [ 1663 | "bytemuck", 1664 | ] 1665 | 1666 | [[package]] 1667 | name = "same-file" 1668 | version = "1.0.6" 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" 1670 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1671 | dependencies = [ 1672 | "winapi-util", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "scoped-tls" 1677 | version = "1.0.0" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 1680 | 1681 | [[package]] 1682 | name = "scopeguard" 1683 | version = "1.1.0" 1684 | source = "registry+https://github.com/rust-lang/crates.io-index" 1685 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1686 | 1687 | [[package]] 1688 | name = "send_wrapper" 1689 | version = "0.2.0" 1690 | source = "registry+https://github.com/rust-lang/crates.io-index" 1691 | checksum = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" 1692 | 1693 | [[package]] 1694 | name = "serde" 1695 | version = "1.0.117" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" 1698 | dependencies = [ 1699 | "serde_derive", 1700 | ] 1701 | 1702 | [[package]] 1703 | name = "serde_derive" 1704 | version = "1.0.117" 1705 | source = "registry+https://github.com/rust-lang/crates.io-index" 1706 | checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" 1707 | dependencies = [ 1708 | "proc-macro2 1.0.24", 1709 | "quote 1.0.7", 1710 | "syn", 1711 | ] 1712 | 1713 | [[package]] 1714 | name = "shared_library" 1715 | version = "0.1.9" 1716 | source = "registry+https://github.com/rust-lang/crates.io-index" 1717 | checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" 1718 | dependencies = [ 1719 | "lazy_static", 1720 | "libc", 1721 | ] 1722 | 1723 | [[package]] 1724 | name = "signal-hook" 1725 | version = "0.1.16" 1726 | source = "registry+https://github.com/rust-lang/crates.io-index" 1727 | checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" 1728 | dependencies = [ 1729 | "libc", 1730 | "mio 0.7.6", 1731 | "signal-hook-registry", 1732 | ] 1733 | 1734 | [[package]] 1735 | name = "signal-hook-registry" 1736 | version = "1.2.2" 1737 | source = "registry+https://github.com/rust-lang/crates.io-index" 1738 | checksum = "ce32ea0c6c56d5eacaeb814fbed9960547021d3edd010ded1425f180536b20ab" 1739 | dependencies = [ 1740 | "libc", 1741 | ] 1742 | 1743 | [[package]] 1744 | name = "slab" 1745 | version = "0.4.2" 1746 | source = "registry+https://github.com/rust-lang/crates.io-index" 1747 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1748 | 1749 | [[package]] 1750 | name = "slotmap" 1751 | version = "0.3.0" 1752 | source = "registry+https://github.com/rust-lang/crates.io-index" 1753 | checksum = "759fd553261805f128e2900bf69ab3d034260bc338caf7f0ee54dbf035c85acd" 1754 | 1755 | [[package]] 1756 | name = "smallvec" 1757 | version = "1.4.2" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" 1760 | 1761 | [[package]] 1762 | name = "smithay-client-toolkit" 1763 | version = "0.6.6" 1764 | source = "registry+https://github.com/rust-lang/crates.io-index" 1765 | checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" 1766 | dependencies = [ 1767 | "andrew 0.2.1", 1768 | "bitflags", 1769 | "dlib", 1770 | "lazy_static", 1771 | "memmap", 1772 | "nix 0.14.1", 1773 | "wayland-client 0.23.6", 1774 | "wayland-protocols 0.23.6", 1775 | ] 1776 | 1777 | [[package]] 1778 | name = "smithay-client-toolkit" 1779 | version = "0.12.0" 1780 | source = "registry+https://github.com/rust-lang/crates.io-index" 1781 | checksum = "2ec5c077def8af49f9b5aeeb5fcf8079c638c6615c3a8f9305e2dea601de57f7" 1782 | dependencies = [ 1783 | "andrew 0.3.1", 1784 | "bitflags", 1785 | "byteorder", 1786 | "calloop 0.6.5", 1787 | "dlib", 1788 | "lazy_static", 1789 | "log", 1790 | "memmap", 1791 | "nix 0.18.0", 1792 | "wayland-client 0.28.2", 1793 | "wayland-cursor", 1794 | "wayland-protocols 0.28.2", 1795 | ] 1796 | 1797 | [[package]] 1798 | name = "socket2" 1799 | version = "0.3.17" 1800 | source = "registry+https://github.com/rust-lang/crates.io-index" 1801 | checksum = "2c29947abdee2a218277abeca306f25789c938e500ea5a9d4b12a5a504466902" 1802 | dependencies = [ 1803 | "cfg-if 1.0.0", 1804 | "libc", 1805 | "redox_syscall", 1806 | "winapi 0.3.9", 1807 | ] 1808 | 1809 | [[package]] 1810 | name = "stb_truetype" 1811 | version = "0.3.1" 1812 | source = "registry+https://github.com/rust-lang/crates.io-index" 1813 | checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" 1814 | dependencies = [ 1815 | "byteorder", 1816 | ] 1817 | 1818 | [[package]] 1819 | name = "strsim" 1820 | version = "0.9.3" 1821 | source = "registry+https://github.com/rust-lang/crates.io-index" 1822 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 1823 | 1824 | [[package]] 1825 | name = "syn" 1826 | version = "1.0.53" 1827 | source = "registry+https://github.com/rust-lang/crates.io-index" 1828 | checksum = "8833e20724c24de12bbaba5ad230ea61c3eafb05b881c7c9d3cfe8638b187e68" 1829 | dependencies = [ 1830 | "proc-macro2 1.0.24", 1831 | "quote 1.0.7", 1832 | "unicode-xid 0.2.1", 1833 | ] 1834 | 1835 | [[package]] 1836 | name = "text-rts" 1837 | version = "0.1.0" 1838 | dependencies = [ 1839 | "bracket-lib", 1840 | "legion", 1841 | "rand", 1842 | "wasm-bindgen", 1843 | "winit 0.23.0", 1844 | ] 1845 | 1846 | [[package]] 1847 | name = "thiserror" 1848 | version = "1.0.22" 1849 | source = "registry+https://github.com/rust-lang/crates.io-index" 1850 | checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" 1851 | dependencies = [ 1852 | "thiserror-impl", 1853 | ] 1854 | 1855 | [[package]] 1856 | name = "thiserror-impl" 1857 | version = "1.0.22" 1858 | source = "registry+https://github.com/rust-lang/crates.io-index" 1859 | checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" 1860 | dependencies = [ 1861 | "proc-macro2 1.0.24", 1862 | "quote 1.0.7", 1863 | "syn", 1864 | ] 1865 | 1866 | [[package]] 1867 | name = "thread_local" 1868 | version = "1.0.1" 1869 | source = "registry+https://github.com/rust-lang/crates.io-index" 1870 | checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" 1871 | dependencies = [ 1872 | "lazy_static", 1873 | ] 1874 | 1875 | [[package]] 1876 | name = "tokio-executor" 1877 | version = "0.1.10" 1878 | source = "registry+https://github.com/rust-lang/crates.io-index" 1879 | checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" 1880 | dependencies = [ 1881 | "crossbeam-utils 0.7.2", 1882 | "futures", 1883 | ] 1884 | 1885 | [[package]] 1886 | name = "tokio-timer" 1887 | version = "0.2.13" 1888 | source = "registry+https://github.com/rust-lang/crates.io-index" 1889 | checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" 1890 | dependencies = [ 1891 | "crossbeam-utils 0.7.2", 1892 | "futures", 1893 | "slab", 1894 | "tokio-executor", 1895 | ] 1896 | 1897 | [[package]] 1898 | name = "toml" 1899 | version = "0.5.7" 1900 | source = "registry+https://github.com/rust-lang/crates.io-index" 1901 | checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" 1902 | dependencies = [ 1903 | "serde", 1904 | ] 1905 | 1906 | [[package]] 1907 | name = "ttf-parser" 1908 | version = "0.6.2" 1909 | source = "registry+https://github.com/rust-lang/crates.io-index" 1910 | checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" 1911 | 1912 | [[package]] 1913 | name = "ultraviolet" 1914 | version = "0.7.5" 1915 | source = "registry+https://github.com/rust-lang/crates.io-index" 1916 | checksum = "c6650a58414f856056ccc651abd3b9d80c384206250c3a621224497503a0f9f2" 1917 | dependencies = [ 1918 | "wide", 1919 | ] 1920 | 1921 | [[package]] 1922 | name = "unicode-xid" 1923 | version = "0.1.0" 1924 | source = "registry+https://github.com/rust-lang/crates.io-index" 1925 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 1926 | 1927 | [[package]] 1928 | name = "unicode-xid" 1929 | version = "0.2.1" 1930 | source = "registry+https://github.com/rust-lang/crates.io-index" 1931 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 1932 | 1933 | [[package]] 1934 | name = "uuid" 1935 | version = "0.8.1" 1936 | source = "registry+https://github.com/rust-lang/crates.io-index" 1937 | checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" 1938 | dependencies = [ 1939 | "rand", 1940 | "serde", 1941 | ] 1942 | 1943 | [[package]] 1944 | name = "version_check" 1945 | version = "0.9.2" 1946 | source = "registry+https://github.com/rust-lang/crates.io-index" 1947 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 1948 | 1949 | [[package]] 1950 | name = "void" 1951 | version = "1.0.2" 1952 | source = "registry+https://github.com/rust-lang/crates.io-index" 1953 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1954 | 1955 | [[package]] 1956 | name = "walkdir" 1957 | version = "2.3.1" 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" 1959 | checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" 1960 | dependencies = [ 1961 | "same-file", 1962 | "winapi 0.3.9", 1963 | "winapi-util", 1964 | ] 1965 | 1966 | [[package]] 1967 | name = "wasi" 1968 | version = "0.9.0+wasi-snapshot-preview1" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1971 | 1972 | [[package]] 1973 | name = "wasm-bindgen" 1974 | version = "0.2.69" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" 1977 | dependencies = [ 1978 | "cfg-if 1.0.0", 1979 | "wasm-bindgen-macro", 1980 | ] 1981 | 1982 | [[package]] 1983 | name = "wasm-bindgen-backend" 1984 | version = "0.2.69" 1985 | source = "registry+https://github.com/rust-lang/crates.io-index" 1986 | checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" 1987 | dependencies = [ 1988 | "bumpalo", 1989 | "lazy_static", 1990 | "log", 1991 | "proc-macro2 1.0.24", 1992 | "quote 1.0.7", 1993 | "syn", 1994 | "wasm-bindgen-shared", 1995 | ] 1996 | 1997 | [[package]] 1998 | name = "wasm-bindgen-macro" 1999 | version = "0.2.69" 2000 | source = "registry+https://github.com/rust-lang/crates.io-index" 2001 | checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" 2002 | dependencies = [ 2003 | "quote 1.0.7", 2004 | "wasm-bindgen-macro-support", 2005 | ] 2006 | 2007 | [[package]] 2008 | name = "wasm-bindgen-macro-support" 2009 | version = "0.2.69" 2010 | source = "registry+https://github.com/rust-lang/crates.io-index" 2011 | checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" 2012 | dependencies = [ 2013 | "proc-macro2 1.0.24", 2014 | "quote 1.0.7", 2015 | "syn", 2016 | "wasm-bindgen-backend", 2017 | "wasm-bindgen-shared", 2018 | ] 2019 | 2020 | [[package]] 2021 | name = "wasm-bindgen-shared" 2022 | version = "0.2.69" 2023 | source = "registry+https://github.com/rust-lang/crates.io-index" 2024 | checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" 2025 | 2026 | [[package]] 2027 | name = "wasm-timer" 2028 | version = "0.1.3" 2029 | source = "registry+https://github.com/rust-lang/crates.io-index" 2030 | checksum = "aa3e01d234bb71760e685cfafa5e2c96f8ad877c161a721646356651069e26ac" 2031 | dependencies = [ 2032 | "futures", 2033 | "js-sys", 2034 | "send_wrapper", 2035 | "tokio-timer", 2036 | "wasm-bindgen", 2037 | "web-sys", 2038 | ] 2039 | 2040 | [[package]] 2041 | name = "wayland-client" 2042 | version = "0.23.6" 2043 | source = "registry+https://github.com/rust-lang/crates.io-index" 2044 | checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" 2045 | dependencies = [ 2046 | "bitflags", 2047 | "calloop 0.4.4", 2048 | "downcast-rs", 2049 | "libc", 2050 | "mio 0.6.23", 2051 | "nix 0.14.1", 2052 | "wayland-commons 0.23.6", 2053 | "wayland-scanner 0.23.6", 2054 | "wayland-sys 0.23.6", 2055 | ] 2056 | 2057 | [[package]] 2058 | name = "wayland-client" 2059 | version = "0.28.2" 2060 | source = "registry+https://github.com/rust-lang/crates.io-index" 2061 | checksum = "222b227f47871e47d657c1c5e5360b4af9a877aa9c892716787be1c192c78c42" 2062 | dependencies = [ 2063 | "bitflags", 2064 | "downcast-rs", 2065 | "libc", 2066 | "nix 0.18.0", 2067 | "scoped-tls", 2068 | "wayland-commons 0.28.2", 2069 | "wayland-scanner 0.28.2", 2070 | "wayland-sys 0.28.2", 2071 | ] 2072 | 2073 | [[package]] 2074 | name = "wayland-commons" 2075 | version = "0.23.6" 2076 | source = "registry+https://github.com/rust-lang/crates.io-index" 2077 | checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" 2078 | dependencies = [ 2079 | "nix 0.14.1", 2080 | "wayland-sys 0.23.6", 2081 | ] 2082 | 2083 | [[package]] 2084 | name = "wayland-commons" 2085 | version = "0.28.2" 2086 | source = "registry+https://github.com/rust-lang/crates.io-index" 2087 | checksum = "230b3ffeda101f877ff8ecb8573f5d26e7beb345b197807c4df34ec06879a3e6" 2088 | dependencies = [ 2089 | "nix 0.18.0", 2090 | "once_cell", 2091 | "smallvec", 2092 | "wayland-sys 0.28.2", 2093 | ] 2094 | 2095 | [[package]] 2096 | name = "wayland-cursor" 2097 | version = "0.28.2" 2098 | source = "registry+https://github.com/rust-lang/crates.io-index" 2099 | checksum = "0aad1b4301cdccfb5f64056a4736e8155a5f4734bac41fdbca80b1fdbe1ab3e1" 2100 | dependencies = [ 2101 | "nix 0.18.0", 2102 | "wayland-client 0.28.2", 2103 | "xcursor", 2104 | ] 2105 | 2106 | [[package]] 2107 | name = "wayland-egl" 2108 | version = "0.28.2" 2109 | source = "registry+https://github.com/rust-lang/crates.io-index" 2110 | checksum = "308f3ec651a099d1aa4e60625c81f67b4264d72d1b524bc7fb1a7675f7c050b4" 2111 | dependencies = [ 2112 | "wayland-client 0.28.2", 2113 | "wayland-sys 0.28.2", 2114 | ] 2115 | 2116 | [[package]] 2117 | name = "wayland-protocols" 2118 | version = "0.23.6" 2119 | source = "registry+https://github.com/rust-lang/crates.io-index" 2120 | checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" 2121 | dependencies = [ 2122 | "bitflags", 2123 | "wayland-client 0.23.6", 2124 | "wayland-commons 0.23.6", 2125 | "wayland-scanner 0.23.6", 2126 | ] 2127 | 2128 | [[package]] 2129 | name = "wayland-protocols" 2130 | version = "0.28.2" 2131 | source = "registry+https://github.com/rust-lang/crates.io-index" 2132 | checksum = "dc16a9db803cae58b45f9a84a6cf364434cc49a95c8b1ef98ffeb467d228bdc9" 2133 | dependencies = [ 2134 | "bitflags", 2135 | "wayland-client 0.28.2", 2136 | "wayland-commons 0.28.2", 2137 | "wayland-scanner 0.28.2", 2138 | ] 2139 | 2140 | [[package]] 2141 | name = "wayland-scanner" 2142 | version = "0.23.6" 2143 | source = "registry+https://github.com/rust-lang/crates.io-index" 2144 | checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" 2145 | dependencies = [ 2146 | "proc-macro2 0.4.30", 2147 | "quote 0.6.13", 2148 | "xml-rs", 2149 | ] 2150 | 2151 | [[package]] 2152 | name = "wayland-scanner" 2153 | version = "0.28.2" 2154 | source = "registry+https://github.com/rust-lang/crates.io-index" 2155 | checksum = "5ee5bd43a1d746efc486515fec561e47205f328b74802b959f10f5500f7e56cc" 2156 | dependencies = [ 2157 | "proc-macro2 1.0.24", 2158 | "quote 1.0.7", 2159 | "xml-rs", 2160 | ] 2161 | 2162 | [[package]] 2163 | name = "wayland-sys" 2164 | version = "0.23.6" 2165 | source = "registry+https://github.com/rust-lang/crates.io-index" 2166 | checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" 2167 | dependencies = [ 2168 | "dlib", 2169 | "lazy_static", 2170 | ] 2171 | 2172 | [[package]] 2173 | name = "wayland-sys" 2174 | version = "0.28.2" 2175 | source = "registry+https://github.com/rust-lang/crates.io-index" 2176 | checksum = "0814adbecc7ea97869971e1d1c1b657e31863dda6fd768f119ad3dc408a01e58" 2177 | dependencies = [ 2178 | "dlib", 2179 | "lazy_static", 2180 | "pkg-config", 2181 | ] 2182 | 2183 | [[package]] 2184 | name = "web-sys" 2185 | version = "0.3.46" 2186 | source = "registry+https://github.com/rust-lang/crates.io-index" 2187 | checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" 2188 | dependencies = [ 2189 | "js-sys", 2190 | "wasm-bindgen", 2191 | ] 2192 | 2193 | [[package]] 2194 | name = "wide" 2195 | version = "0.5.5" 2196 | source = "registry+https://github.com/rust-lang/crates.io-index" 2197 | checksum = "80b27c76ecc22bd81fe681d9c9eac81e002d7b7048105ee4608f57c4e92e9211" 2198 | dependencies = [ 2199 | "bytemuck", 2200 | "safe_arch", 2201 | ] 2202 | 2203 | [[package]] 2204 | name = "winapi" 2205 | version = "0.2.8" 2206 | source = "registry+https://github.com/rust-lang/crates.io-index" 2207 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 2208 | 2209 | [[package]] 2210 | name = "winapi" 2211 | version = "0.3.9" 2212 | source = "registry+https://github.com/rust-lang/crates.io-index" 2213 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2214 | dependencies = [ 2215 | "winapi-i686-pc-windows-gnu", 2216 | "winapi-x86_64-pc-windows-gnu", 2217 | ] 2218 | 2219 | [[package]] 2220 | name = "winapi-build" 2221 | version = "0.1.1" 2222 | source = "registry+https://github.com/rust-lang/crates.io-index" 2223 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 2224 | 2225 | [[package]] 2226 | name = "winapi-i686-pc-windows-gnu" 2227 | version = "0.4.0" 2228 | source = "registry+https://github.com/rust-lang/crates.io-index" 2229 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2230 | 2231 | [[package]] 2232 | name = "winapi-util" 2233 | version = "0.1.5" 2234 | source = "registry+https://github.com/rust-lang/crates.io-index" 2235 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2236 | dependencies = [ 2237 | "winapi 0.3.9", 2238 | ] 2239 | 2240 | [[package]] 2241 | name = "winapi-x86_64-pc-windows-gnu" 2242 | version = "0.4.0" 2243 | source = "registry+https://github.com/rust-lang/crates.io-index" 2244 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2245 | 2246 | [[package]] 2247 | name = "winit" 2248 | version = "0.22.2" 2249 | source = "registry+https://github.com/rust-lang/crates.io-index" 2250 | checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" 2251 | dependencies = [ 2252 | "bitflags", 2253 | "cocoa 0.20.2", 2254 | "core-foundation 0.7.0", 2255 | "core-graphics 0.19.2", 2256 | "core-video-sys", 2257 | "dispatch", 2258 | "instant", 2259 | "lazy_static", 2260 | "libc", 2261 | "log", 2262 | "mio 0.6.23", 2263 | "mio-extras", 2264 | "ndk 0.1.0", 2265 | "ndk-glue 0.1.0", 2266 | "ndk-sys 0.1.0", 2267 | "objc", 2268 | "parking_lot 0.10.2", 2269 | "percent-encoding", 2270 | "raw-window-handle", 2271 | "smithay-client-toolkit 0.6.6", 2272 | "wasm-bindgen", 2273 | "wayland-client 0.23.6", 2274 | "web-sys", 2275 | "winapi 0.3.9", 2276 | "x11-dl", 2277 | ] 2278 | 2279 | [[package]] 2280 | name = "winit" 2281 | version = "0.23.0" 2282 | source = "registry+https://github.com/rust-lang/crates.io-index" 2283 | checksum = "b5bc559da567d8aa671bbcd08304d49e982c7bf2cb91e10288b9188931c1b772" 2284 | dependencies = [ 2285 | "bitflags", 2286 | "cocoa 0.23.0", 2287 | "core-foundation 0.9.1", 2288 | "core-graphics 0.22.1", 2289 | "core-video-sys", 2290 | "dispatch", 2291 | "instant", 2292 | "lazy_static", 2293 | "libc", 2294 | "log", 2295 | "mio 0.6.23", 2296 | "mio-extras", 2297 | "ndk 0.2.1", 2298 | "ndk-glue 0.2.1", 2299 | "ndk-sys 0.2.1", 2300 | "objc", 2301 | "parking_lot 0.11.1", 2302 | "percent-encoding", 2303 | "raw-window-handle", 2304 | "smithay-client-toolkit 0.12.0", 2305 | "wayland-client 0.28.2", 2306 | "winapi 0.3.9", 2307 | "x11-dl", 2308 | ] 2309 | 2310 | [[package]] 2311 | name = "ws2_32-sys" 2312 | version = "0.2.1" 2313 | source = "registry+https://github.com/rust-lang/crates.io-index" 2314 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 2315 | dependencies = [ 2316 | "winapi 0.2.8", 2317 | "winapi-build", 2318 | ] 2319 | 2320 | [[package]] 2321 | name = "x11-dl" 2322 | version = "2.18.5" 2323 | source = "registry+https://github.com/rust-lang/crates.io-index" 2324 | checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" 2325 | dependencies = [ 2326 | "lazy_static", 2327 | "libc", 2328 | "maybe-uninit", 2329 | "pkg-config", 2330 | ] 2331 | 2332 | [[package]] 2333 | name = "xcursor" 2334 | version = "0.3.3" 2335 | source = "registry+https://github.com/rust-lang/crates.io-index" 2336 | checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" 2337 | dependencies = [ 2338 | "nom", 2339 | ] 2340 | 2341 | [[package]] 2342 | name = "xdg" 2343 | version = "2.2.0" 2344 | source = "registry+https://github.com/rust-lang/crates.io-index" 2345 | checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" 2346 | 2347 | [[package]] 2348 | name = "xml-rs" 2349 | version = "0.8.3" 2350 | source = "registry+https://github.com/rust-lang/crates.io-index" 2351 | checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" 2352 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "text-rts" 3 | description = "A text-based sci-fi themed real-time strategy game" 4 | version = "0.1.0" 5 | authors = ["Maxwell Anderson "] 6 | edition = "2018" 7 | keywords = ["text", "rts", "strategy", "game", "text-based"] 8 | categories = ["games"] 9 | license = "MIT" 10 | homepage = "https://github.com/Maxgy/text-rts" 11 | repository = "https://github.com/Maxgy/text-rts" 12 | 13 | [features] 14 | default = ["bracket-lib/opengl", "legion/default"] 15 | web = ["bracket-lib/opengl"] 16 | console = ["bracket-lib/crossterm", "legion/default"] 17 | 18 | [dependencies] 19 | legion = { version = "0.3", default-features = false } 20 | bracket-lib = { git = "https://github.com/thebracket/bracket-lib", version = "0.8", default-features = false, features = ["threaded"] } 21 | rand = { version = "0.7", features = ["wasm-bindgen"] } 22 | 23 | wasm-bindgen = { version = "0.2", optional = true } 24 | 25 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 26 | winit = "0.23" 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Maxwell Anderson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TextRTS 2 | 3 | ![Linux](https://github.com/Maxgy/text-rts/workflows/Linux/badge.svg) 4 | ![Windows](https://github.com/Maxgy/text-rts/workflows/Windows/badge.svg) 5 | ![Mac](https://github.com/Maxgy/text-rts/workflows/Mac/badge.svg) 6 | 7 | A text-based sci-fi themed real-time strategy game made with Rust, Bracket-lib, and Legion 8 | 9 | ## Controls 10 | 11 | * Left click : Select one unit or clear selection 12 | * Left click and drag a selection : Select all units within the box 13 | * Right click (doesn't work on web version) : Move selected units 14 | * M -> Left click : Move selected units 15 | * A -> Left click : Attack-move selected units 16 | * S : Stop selected units 17 | * H : Hold position selected units 18 | * B : Build mode 19 | * F : Focus on selected units 20 | * Ctrl -> Left click unit : Select all nearby units of the same type 21 | * Shift -> select units : Add units to current unit selection 22 | * Ctrl -> <0-9> : Set control group to current unit selection 23 | * Shift -> <0-9> : Add current unit selection to control group 24 | * <0-9> : Select the control group 25 | * Shift -> [f2-f4] : Create a camera hotkey 26 | * [f2-f4] : Move to a camera location 27 | 28 | ## Screenshot 29 | ![Game Screenshot](https://github.com/Maxgy/text-rts/blob/master/Screenshot.png?raw=true) 30 | -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaechus/text-rts/1a2f9af7f46749881ddb7af1e59680defbd65bb0/Screenshot.png -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | run: 2 | cargo run --release 3 | 4 | console: 5 | cargo run --no-default-features --features console 6 | 7 | test: 8 | cargo clippy 9 | cargo test 10 | 11 | c: 12 | cargo fmt 13 | cargo update 14 | 15 | cargo clippy 16 | cargo c 17 | 18 | cargo doc 19 | cargo build 20 | 21 | cargo test -------------------------------------------------------------------------------- /src/components/building.rs: -------------------------------------------------------------------------------- 1 | // pub struct Building; 2 | 3 | // impl Building {} 4 | -------------------------------------------------------------------------------- /src/components/gamecell.rs: -------------------------------------------------------------------------------- 1 | use std::cmp::Ordering; 2 | 3 | use rand::Rng; 4 | 5 | use bracket_lib::prelude::*; 6 | 7 | use crate::types::Mode; 8 | 9 | #[derive(Clone, Debug)] 10 | pub struct GameCell { 11 | point: PointF, 12 | symbol: char, 13 | color: RGB, 14 | selected: bool, 15 | destination: Option, 16 | mode: Mode, 17 | tic: f32, 18 | harmed: bool, 19 | } 20 | 21 | impl GameCell { 22 | pub fn new(x: i32, y: i32, symbol: char, color: RGB) -> Self { 23 | Self { 24 | point: PointF::new(x as f32, y as f32), 25 | symbol, 26 | color, 27 | selected: false, 28 | destination: None, 29 | mode: Mode::Select, 30 | tic: 0.0, 31 | harmed: false, 32 | } 33 | } 34 | 35 | pub fn move_pos(&mut self, point: Point, mode: Mode) { 36 | self.mode = mode; 37 | self.destination = Some(point); 38 | } 39 | pub fn move_towards(&mut self, other: Point) { 40 | if self.destination.is_none() { 41 | let a = match self.x().cmp(&other.x) { 42 | Ordering::Less => 1, 43 | Ordering::Greater => -1, 44 | _ => 0, 45 | }; 46 | let b = match self.y().cmp(&other.y) { 47 | Ordering::Less => 1, 48 | Ordering::Greater => -1, 49 | _ => 0, 50 | }; 51 | self.destination = Some(Point::new(self.x() + a, self.y() + b)); 52 | } 53 | } 54 | pub fn move_to_attacker(&mut self, other: Point) { 55 | if !self.is_holding() && !self.is_moving() { 56 | self.move_pos(other, Mode::Attack); 57 | } 58 | } 59 | pub fn stop_moving(&mut self) { 60 | if !self.is_holding() { 61 | self.mode = Mode::Select 62 | }; 63 | self.destination = None; 64 | } 65 | pub fn is_moving(&self) -> bool { 66 | self.mode == Mode::Move 67 | } 68 | 69 | pub fn hold(&mut self) { 70 | self.mode = Mode::Hold; 71 | self.destination = None; 72 | } 73 | pub fn is_holding(&self) -> bool { 74 | self.mode == Mode::Hold 75 | } 76 | 77 | pub fn update(&mut self, dt: f32, speed: f32) { 78 | if self.tic > 0.6 { 79 | self.harmed = false; 80 | } 81 | 82 | if self.tic > 1.0 { 83 | self.tic = 0.0; 84 | self.harmed = false; 85 | } else { 86 | self.tic += dt; 87 | } 88 | 89 | if let Some(dest) = self.destination { 90 | let distx = dest.x as f32 - self.point.x; 91 | let disty = dest.y as f32 - self.point.y; 92 | let dist = (distx * distx + disty * disty).sqrt(); 93 | 94 | if dist != 0.0 { 95 | self.point.x += distx / dist * speed * dt; 96 | self.point.y += disty / dist * speed * dt; 97 | } 98 | 99 | if Rect::with_exact(dest.x - 1, dest.y - 1, dest.x + 1, dest.y + 1) 100 | .point_in_rect(self.point()) 101 | { 102 | self.stop_moving(); 103 | } 104 | } else { 105 | self.point.x = self.point.x.round(); 106 | self.point.y = self.point.y.round(); 107 | } 108 | } 109 | 110 | /// Randomly move the cell in one of 8 directions 111 | pub fn bump(&mut self) { 112 | if self.tic >= 0.1 { 113 | let (a, b) = match rand::thread_rng().gen_range(0, 7) { 114 | 0 => (0.0, -1.0), 115 | 1 => (1.0, -1.0), 116 | 2 => (1.0, 0.0), 117 | 3 => (1.0, 1.0), 118 | 4 => (0.0, 1.0), 119 | 5 => (-1.0, 1.0), 120 | 6 => (-1.0, 0.0), 121 | _ => (-1.0, -1.0), 122 | }; 123 | self.point.x += a; 124 | self.point.y += b; 125 | self.tic = 0.0; 126 | } 127 | } 128 | 129 | /// Given a positive range value, return the range of the cell as a Rect 130 | pub fn range_rect(&self, r: u32) -> Rect { 131 | let r = r as i32 + 1; 132 | Rect::with_exact( 133 | self.x() - r, 134 | self.y() - r, 135 | self.x() + r + 1, 136 | self.y() + r + 1, 137 | ) 138 | } 139 | 140 | /// Select the cell 141 | pub fn select(&mut self) { 142 | self.selected = true; 143 | } 144 | /// Deselect the cell 145 | pub fn deselect(&mut self) { 146 | self.selected = false 147 | } 148 | 149 | /// Set the harmed status of the cell to true, causing it to appear red 150 | pub fn set_harmed(&mut self) { 151 | self.harmed = true; 152 | } 153 | 154 | pub fn point(&self) -> Point { 155 | self.point.into() 156 | } 157 | pub fn x(&self) -> i32 { 158 | self.point.x.round() as i32 159 | } 160 | pub fn y(&self) -> i32 { 161 | self.point.y.round() as i32 162 | } 163 | pub fn symbol(&self) -> char { 164 | self.symbol 165 | } 166 | /// Return the RGB color of the cell; if harmed return red 167 | pub fn color(&self) -> RGB { 168 | if self.harmed { 169 | RGB::named((255, 0, 0)) 170 | } else { 171 | self.color 172 | } 173 | } 174 | /// Return a brightened version of the cell's color 175 | pub fn color_bright(&self) -> RGB { 176 | RGB::from_f32(self.color.r * 1.5, self.color.g * 1.5, self.color.b * 1.5) 177 | } 178 | /// Return a black background for the cell, but black if selected 179 | pub fn bg_color(&self) -> RGB { 180 | if self.selected { 181 | RGB::from_u8(255, 255, 255) 182 | } else { 183 | RGB::new() 184 | } 185 | } 186 | pub fn selected(&self) -> bool { 187 | self.selected 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /src/components/mod.rs: -------------------------------------------------------------------------------- 1 | mod building; 2 | mod gamecell; 3 | mod unit; 4 | 5 | // pub use building::Building; 6 | pub use gamecell::GameCell; 7 | pub use unit::Unit; 8 | -------------------------------------------------------------------------------- /src/components/unit.rs: -------------------------------------------------------------------------------- 1 | use crate::types::{Race, UnitKind}; 2 | 3 | #[derive(Clone, Debug)] 4 | 5 | pub struct Unit { 6 | race: Race, 7 | kind: UnitKind, 8 | hp: (i32, u32), 9 | speed: f32, 10 | damage: u32, 11 | attack_rate: f32, 12 | range: u32, 13 | follow_dist: u32, 14 | tic: f32, 15 | } 16 | 17 | impl Unit { 18 | pub fn new(race: Race, kind: UnitKind, hp: i32) -> Self { 19 | Self { 20 | race, 21 | kind, 22 | hp: (hp, hp as u32), 23 | speed: 13.5, 24 | damage: 1, 25 | attack_rate: 1.0, 26 | range: 0, 27 | follow_dist: 5, 28 | tic: 0.0, 29 | } 30 | } 31 | pub fn with_speed(mut self, x: f32) -> Self { 32 | self.speed = x; 33 | self 34 | } 35 | pub fn with_damage(mut self, x: u32) -> Self { 36 | self.damage = x; 37 | self 38 | } 39 | pub fn with_range(mut self, r: u32, f: u32) -> Self { 40 | self.range = r; 41 | self.follow_dist = f; 42 | self 43 | } 44 | 45 | /// Reduce the Unit's HP by the given value 46 | pub fn harm(&mut self, x: u32) { 47 | self.hp.0 -= x as i32; 48 | } 49 | 50 | pub fn tic(&mut self, dt: f32) { 51 | if self.tic > 5.0 { 52 | self.tic = 0.0; 53 | } else { 54 | self.tic += dt; 55 | } 56 | } 57 | pub fn reset_tic(&mut self) { 58 | self.tic = 0.0; 59 | } 60 | 61 | pub fn race(&self) -> Race { 62 | self.race 63 | } 64 | pub fn kind(&self) -> UnitKind { 65 | self.kind 66 | } 67 | pub fn hp(&self) -> i32 { 68 | self.hp.0 69 | } 70 | pub fn speed(&self) -> f32 { 71 | self.speed 72 | } 73 | pub fn attack(&self) -> Option { 74 | if self.tic >= self.attack_rate { 75 | Some(self.damage) 76 | } else { 77 | None 78 | } 79 | } 80 | pub fn range(&self) -> u32 { 81 | self.range 82 | } 83 | pub fn follow_dist(&self) -> u32 { 84 | self.follow_dist 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod components; 2 | mod state; 3 | mod types; 4 | 5 | pub use state::State; 6 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use winit::event_loop::EventLoop; 2 | 3 | use bracket_lib::prelude::*; 4 | 5 | use text_rts::State; 6 | 7 | fn main() -> BError { 8 | let tw = 24; 9 | let th = 24; 10 | 11 | let size = if let Some(monitor) = EventLoop::new().available_monitors().next() { 12 | (monitor.size().width / tw, monitor.size().height / th) 13 | } else { 14 | (1366 / tw, 768 / th) 15 | }; 16 | 17 | let ctx = BTermBuilder::simple(size.0, size.1)? 18 | .with_tile_dimensions(tw, th) 19 | .with_advanced_input(true) 20 | .with_fps_cap(60.0) 21 | .with_fullscreen(true) 22 | .with_title("TextRTS") 23 | .build()?; 24 | let gs = State::new(size.0 - 1, size.1); 25 | 26 | main_loop(ctx, gs) 27 | } 28 | -------------------------------------------------------------------------------- /src/state/mod.rs: -------------------------------------------------------------------------------- 1 | #[cfg(not(target_arch = "wasm32"))] 2 | use std::time::Instant; 3 | 4 | use bracket_lib::prelude::*; 5 | 6 | use legion::*; 7 | 8 | use crate::{ 9 | components::{GameCell, Unit}, 10 | types::{CtrlGroups, Direction, Map, Mode, Mouse, Race, UnitKind}, 11 | }; 12 | 13 | const WHITE: (u8, u8, u8) = (255, 255, 255); 14 | const DARK_GRAY: (u8, u8, u8) = (100, 100, 100); 15 | const BROWN: (u8, u8, u8) = (170, 30, 0); 16 | const GREEN: (u8, u8, u8) = (0, 170, 0); 17 | const DARK_GREEN: (u8, u8, u8) = (0, 120, 0); 18 | 19 | #[derive(Clone, Debug)] 20 | pub enum CurrentState { 21 | Menu, 22 | Playing, 23 | Quitting, 24 | } 25 | 26 | pub struct State { 27 | curr_state: CurrentState, 28 | world: World, 29 | schedule: Schedule, 30 | window_size: (u32, u32), 31 | tic: u8, 32 | dt: f32, 33 | #[cfg(not(target_arch = "wasm32"))] 34 | instant: Instant, 35 | offset: (i32, i32), 36 | mouse: Mouse, 37 | mode: Mode, 38 | selected: Vec, 39 | ctrl_groups: CtrlGroups, 40 | map: Map, 41 | supply: (i32, i32), 42 | } 43 | 44 | impl State { 45 | pub fn new(w: u32, h: u32) -> Self { 46 | let mut world = World::default(); 47 | 48 | let mut units = Vec::with_capacity(145); 49 | for x in 0..20 { 50 | units.push(( 51 | GameCell::new(10 - (x & 1), x + 5, 'V', RGB::named(GREEN)), 52 | Unit::new(Race::Bionic, UnitKind::Blademaster, 30) 53 | .with_damage(5) 54 | .with_speed(14.5), 55 | )); 56 | units.push(( 57 | GameCell::new(7 - (x & 1), x + 5, 'Y', RGB::named(DARK_GREEN)), 58 | Unit::new(Race::Bionic, UnitKind::Strider, 40) 59 | .with_damage(5) 60 | .with_range(10, 13), 61 | )); 62 | } 63 | for _ in 0..5 { 64 | for y in 0..20 { 65 | units.push(( 66 | GameCell::new(45, 5 + y, '*', RGB::named(BROWN)), 67 | Unit::new(Race::Bug, UnitKind::FleshSpider, 15), 68 | )); 69 | } 70 | } 71 | for x in 0..5 { 72 | units.push(( 73 | GameCell::new(x + 25, 35, 'T', RGB::named(BLUE)), 74 | Unit::new(Race::Alien, UnitKind::Trooper, 20) 75 | .with_damage(2) 76 | .with_range(5, 8) 77 | .with_speed(10.5), 78 | )); 79 | } 80 | world.extend(units); 81 | 82 | let bump_units = SystemBuilder::new("bump_units") 83 | .with_query(<(Read,)>::query().filter(component::())) 84 | .with_query(<(Read,)>::query()) 85 | .write_component::() 86 | .build(|_, world, _, (query, inner_query)| { 87 | let mut bumped = Vec::new(); 88 | for chunk in query.iter_chunks(world) { 89 | for (e, (cell,)) in chunk.into_iter_entities() { 90 | if !cell.is_holding() { 91 | for inner_chunk in inner_query.iter_chunks(world) { 92 | for (e2, (cell2,)) in inner_chunk.into_iter_entities() { 93 | if e != e2 && cell.point() == cell2.point() { 94 | bumped.push(e); 95 | break; 96 | } 97 | } 98 | } 99 | } 100 | } 101 | } 102 | for e in bumped.iter() { 103 | if let Ok(cell) = world.entry_mut(*e).unwrap().get_component_mut::() { 104 | cell.bump(); 105 | } 106 | } 107 | }); 108 | 109 | let attack_units = SystemBuilder::new("attack_units") 110 | .with_query(<(Read, Read)>::query()) 111 | .with_query(<(Read, Read)>::query()) 112 | .with_query(<(Read, Read)>::query()) 113 | .write_component::() 114 | .write_component::() 115 | .build(|_, world, _, (query, attack_query, moving_query)| { 116 | let mut attacking_units = Vec::new(); 117 | let mut moving_units = Vec::new(); 118 | for chunk in query.iter_chunks(world) { 119 | for (e, (cell, unit)) in chunk.into_iter_entities() { 120 | let mut attacked = false; 121 | for attack_chunk in attack_query.iter_chunks(world) { 122 | for (e2, (cell2, unit2)) in attack_chunk.into_iter_entities() { 123 | if unit.race() != unit2.race() 124 | && cell.range_rect(unit.range()).point_in_rect(cell2.point()) 125 | { 126 | attacking_units.push((e, e2, unit.attack(), cell.point())); 127 | attacked = true; 128 | break; 129 | } 130 | } 131 | } 132 | if !attacked && !cell.is_holding() { 133 | for (cell2, unit2) in moving_query.iter(world) { 134 | if unit.race() != unit2.race() 135 | && cell 136 | .range_rect(unit.follow_dist()) 137 | .point_in_rect(cell2.point()) 138 | { 139 | moving_units.push((e, cell2.point())); 140 | break; 141 | } 142 | } 143 | } 144 | } 145 | } 146 | for (e, e2, attack, pt) in attacking_units.iter() { 147 | let is_moving = if let Ok(cell) = 148 | world.entry_mut(*e).unwrap().get_component_mut::() 149 | { 150 | if !cell.is_moving() { 151 | cell.stop_moving(); 152 | false 153 | } else { 154 | true 155 | } 156 | } else { 157 | true 158 | }; 159 | 160 | if !is_moving { 161 | if let Some(damage) = *attack { 162 | if let Ok(unit) = 163 | world.entry_mut(*e).unwrap().get_component_mut::() 164 | { 165 | unit.reset_tic(); 166 | } 167 | 168 | if let Ok(cell2) = world 169 | .entry_mut(*e2) 170 | .unwrap() 171 | .get_component_mut::() 172 | { 173 | cell2.set_harmed(); 174 | cell2.move_to_attacker(*pt); 175 | } 176 | if let Ok(unit2) = 177 | world.entry_mut(*e2).unwrap().get_component_mut::() 178 | { 179 | unit2.harm(damage); 180 | } 181 | } 182 | } 183 | } 184 | for (e, pt2) in moving_units.iter() { 185 | if let Ok(cell) = world.entry_mut(*e).unwrap().get_component_mut::() { 186 | cell.move_towards(*pt2); 187 | } 188 | } 189 | }); 190 | 191 | let clear_units = SystemBuilder::new("clear_units") 192 | .with_query(<(Read,)>::query().filter(maybe_changed::())) 193 | .write_component::() 194 | .build(|commands, world, _, query| { 195 | let mut deleted = Vec::new(); 196 | for chunk in query.iter_chunks(world) { 197 | for (e, (unit,)) in chunk.into_iter_entities() { 198 | if unit.hp() <= 0 { 199 | deleted.push(e); 200 | } 201 | } 202 | } 203 | for e in deleted.iter() { 204 | commands.remove(*e); 205 | } 206 | }); 207 | 208 | let schedule = Schedule::builder() 209 | .add_system(bump_units) 210 | .add_system(attack_units) 211 | .add_system(clear_units) 212 | .flush() 213 | .build(); 214 | 215 | Self { 216 | curr_state: CurrentState::Menu, 217 | world, 218 | schedule, 219 | window_size: (w, h), 220 | dt: 0.016, 221 | #[cfg(not(target_arch = "wasm32"))] 222 | instant: Instant::now(), 223 | tic: 0, 224 | offset: (0, 0), 225 | mouse: Mouse::new(), 226 | mode: Mode::Select, 227 | selected: Vec::new(), 228 | ctrl_groups: CtrlGroups::new(), 229 | map: Map::new(100, 100), 230 | supply: (0, 99), 231 | } 232 | } 233 | 234 | fn menu_state(&mut self, ctx: &mut BTerm) { 235 | ctx.print_centered(self.window_size.1 as i32 / 2 - 1, "TextRTS"); 236 | ctx.print_centered( 237 | self.window_size.1 as i32 / 2 + 1, 238 | "Press the spacebar to start", 239 | ); 240 | 241 | if let Some(VirtualKeyCode::Space) = ctx.key { 242 | self.curr_state = CurrentState::Playing; 243 | } 244 | } 245 | 246 | fn play_state(&mut self, ctx: &mut BTerm) { 247 | let mut resources = Resources::default(); 248 | self.schedule.execute(&mut self.world, &mut resources); 249 | 250 | self.print_grid(ctx); 251 | 252 | if self.mouse.y() < self.window_size.1 as i32 - 5 { 253 | self.mouse.print_cursor(ctx, self.mode, self.tic); 254 | } 255 | 256 | self.render_cells(ctx); 257 | 258 | self.print_mode(ctx); 259 | 260 | self.print_cash(ctx); 261 | 262 | self.mouse_input(); 263 | 264 | self.key_input(ctx); 265 | 266 | self.draw_highlight_box(ctx); 267 | 268 | self.print_bottom_bar(ctx); 269 | } 270 | 271 | fn mode(&self) -> Mode { 272 | self.mode 273 | } 274 | fn set_mode(&mut self, mode: Mode) { 275 | self.mode = mode; 276 | } 277 | 278 | fn scroll(&mut self, d: Direction) { 279 | match d { 280 | Direction::N => { 281 | if self.offset.1 < self.map.upper_y() { 282 | self.offset.1 += 1 283 | } 284 | } 285 | Direction::S => { 286 | if self.offset.1 > self.map.lower_y() { 287 | self.offset.1 -= 1 288 | } 289 | } 290 | Direction::E => { 291 | if self.offset.0 > self.map.lower_x() { 292 | self.offset.0 -= 1 293 | } 294 | } 295 | Direction::W => { 296 | if self.offset.0 < self.map.upper_x() { 297 | self.offset.0 += 1 298 | } 299 | } 300 | } 301 | } 302 | 303 | fn mouse_input(&mut self) { 304 | if self.mouse.select_one() { 305 | if self.mouse.x() <= 0 { 306 | self.scroll(Direction::W); 307 | } else if self.mouse.x() >= self.window_size.0 as i32 - 1 { 308 | self.scroll(Direction::E); 309 | } 310 | if self.mouse.y() <= 0 { 311 | self.scroll(Direction::N); 312 | } else if self.mouse.y() >= self.window_size.1 as i32 - 1 { 313 | self.scroll(Direction::S); 314 | } 315 | } 316 | 317 | match self.mouse.click { 318 | Some((0, false)) => match self.mode() { 319 | Mode::Select | Mode::Add => self.select_cells(), 320 | Mode::Move | Mode::Attack => { 321 | self.move_cells(self.mode()); 322 | self.set_mode(Mode::Select); 323 | } 324 | Mode::Ctrl => self.select_same(), 325 | _ => (), 326 | }, 327 | Some((1, false)) => { 328 | self.move_cells(Mode::Move); 329 | self.set_mode(Mode::Select); 330 | } 331 | _ => (), 332 | } 333 | } 334 | 335 | fn key_num(key: VirtualKeyCode) -> Option { 336 | match key { 337 | VirtualKeyCode::Key0 => Some(0), 338 | VirtualKeyCode::Key1 => Some(1), 339 | VirtualKeyCode::Key2 => Some(2), 340 | VirtualKeyCode::Key3 => Some(3), 341 | VirtualKeyCode::Key4 => Some(4), 342 | VirtualKeyCode::Key5 => Some(5), 343 | VirtualKeyCode::Key6 => Some(6), 344 | VirtualKeyCode::Key7 => Some(7), 345 | VirtualKeyCode::Key8 => Some(8), 346 | VirtualKeyCode::Key9 => Some(9), 347 | _ => None, 348 | } 349 | } 350 | 351 | fn key_input(&mut self, ctx: &mut BTerm) { 352 | if let Some(key) = ctx.key { 353 | match self.mode { 354 | Mode::Ctrl => { 355 | if let Some(n) = State::key_num(key) { 356 | if !self.selected.is_empty() { 357 | self.ctrl_groups.bind(n, self.selected.clone()); 358 | } 359 | } 360 | self.set_mode(Mode::Select); 361 | } 362 | Mode::Add => { 363 | if let Some(n) = State::key_num(key) { 364 | self.ctrl_groups.add_to(n, &mut self.selected.clone()); 365 | } else { 366 | match key { 367 | VirtualKeyCode::F2 => self.ctrl_groups.set_cam(0, self.offset), 368 | VirtualKeyCode::F3 => self.ctrl_groups.set_cam(1, self.offset), 369 | VirtualKeyCode::F4 => self.ctrl_groups.set_cam(2, self.offset), 370 | _ => (), 371 | } 372 | } 373 | self.set_mode(Mode::Select); 374 | } 375 | _ => match key { 376 | VirtualKeyCode::M => { 377 | if !self.selected.is_empty() { 378 | self.set_mode(Mode::Move) 379 | } 380 | } 381 | VirtualKeyCode::A => { 382 | if !self.selected.is_empty() { 383 | self.set_mode(Mode::Attack) 384 | } 385 | } 386 | VirtualKeyCode::B => self.set_mode(Mode::Build), 387 | VirtualKeyCode::S => self.stop_cells(), 388 | VirtualKeyCode::H => self.hold_cells(), 389 | VirtualKeyCode::F => self.focus_cell(), 390 | 391 | VirtualKeyCode::LControl | VirtualKeyCode::RControl => { 392 | self.set_mode(Mode::Ctrl) 393 | } 394 | VirtualKeyCode::LShift | VirtualKeyCode::RShift => self.set_mode(Mode::Add), 395 | 396 | VirtualKeyCode::F2 => self.offset = self.ctrl_groups.cam(0), 397 | VirtualKeyCode::F3 => self.offset = self.ctrl_groups.cam(1), 398 | VirtualKeyCode::F4 => self.offset = self.ctrl_groups.cam(2), 399 | 400 | VirtualKeyCode::Escape => self.set_mode(Mode::Select), 401 | VirtualKeyCode::Up => self.scroll(Direction::N), 402 | VirtualKeyCode::Down => self.scroll(Direction::S), 403 | VirtualKeyCode::Left => self.scroll(Direction::W), 404 | VirtualKeyCode::Right => self.scroll(Direction::E), 405 | VirtualKeyCode::End => self.curr_state = CurrentState::Quitting, 406 | _ => { 407 | if let Some(n) = State::key_num(key) { 408 | if let Some(group) = self.ctrl_groups.group(n) { 409 | self.selected = group.clone(); 410 | self.load_ctrl_group(); 411 | } 412 | } 413 | } 414 | }, 415 | } 416 | } 417 | } 418 | 419 | fn draw_highlight_box(&mut self, ctx: &mut BTerm) { 420 | if let Mode::Select | Mode::Add = self.mode { 421 | self.mouse.selection.x2 = self.mouse.x(); 422 | self.mouse.selection.y2 = self.mouse.y(); 423 | if self.mouse.left_pressed() && self.mouse.is_pressed() { 424 | let x = if self.mouse.selection.x1 <= self.mouse.selection.x2 { 425 | self.mouse.selection.x1 426 | } else { 427 | self.mouse.selection.x2 428 | }; 429 | let y = if self.mouse.selection.y1 <= self.mouse.selection.y2 { 430 | self.mouse.selection.y1 431 | } else { 432 | self.mouse.selection.y2 433 | }; 434 | ctx.draw_hollow_box( 435 | x, 436 | y, 437 | self.mouse.selection.width(), 438 | self.mouse.selection.height(), 439 | RGB::named(GREEN), 440 | RGB::new(), 441 | ); 442 | } else { 443 | self.mouse.selection.x1 = self.mouse.x(); 444 | self.mouse.selection.y1 = self.mouse.y(); 445 | } 446 | } 447 | } 448 | 449 | fn print_grid(&mut self, ctx: &mut BTerm) { 450 | for x in 0..self.window_size.0 { 451 | for y in 0..self.window_size.1 - 5 { 452 | ctx.print_color(x as i32, y as i32, RGB::named(DARK_GRAY), RGB::new(), ".") 453 | } 454 | } 455 | } 456 | 457 | fn print_mode(&mut self, ctx: &mut BTerm) { 458 | if let Mode::Select = self.mode { 459 | } else { 460 | let mut w = 0; 461 | let mut color = RGB::new(); 462 | let mut s = ""; 463 | match self.mode() { 464 | Mode::Move => { 465 | w = 5; 466 | color = RGB::from_u8(0, 175, 0); 467 | s = "Move"; 468 | } 469 | Mode::Attack => { 470 | w = 7; 471 | color = RGB::from_u8(175, 0, 0); 472 | s = "Attack"; 473 | } 474 | Mode::Build => { 475 | w = 6; 476 | color = RGB::from_u8(0, 0, 175); 477 | s = "Build"; 478 | } 479 | Mode::Ctrl => { 480 | w = 5; 481 | color = RGB::from_u8(75, 75, 75); 482 | s = "Ctrl" 483 | } 484 | Mode::Add => { 485 | w = 4; 486 | color = RGB::from_u8(75, 75, 75); 487 | s = "Add" 488 | } 489 | _ => (), 490 | } 491 | ctx.draw_box(0, 0, w, 2, color, color); 492 | ctx.print_color(1, 1, RGB::named(WHITE), color, s) 493 | } 494 | } 495 | 496 | fn print_cash(&self, ctx: &mut BTerm) { 497 | ctx.print_color( 498 | self.window_size.0 - 7, 499 | 0, 500 | RGB::named(WHITE), 501 | RGB::named(BLACK), 502 | format!( 503 | "{s:>w$}", 504 | s = format!("{} / {}", self.supply.0, self.supply.1), 505 | w = 7 506 | ), 507 | ); 508 | } 509 | 510 | fn print_bottom_bar(&self, ctx: &mut BTerm) { 511 | // full bar 512 | ctx.draw_box( 513 | 0, 514 | self.window_size.1 - 5, 515 | self.window_size.0 - 1, 516 | 4, 517 | RGB::named(WHITE), 518 | RGB::named(BLACK), 519 | ); 520 | // mini map 521 | ctx.draw_box( 522 | 0, 523 | self.window_size.1 - 5, 524 | 4, 525 | 4, 526 | RGB::named(WHITE), 527 | RGB::named(BLACK), 528 | ); 529 | // command grid 530 | ctx.draw_box( 531 | self.window_size.0 - 5, 532 | self.window_size.1 - 5, 533 | 4, 534 | 4, 535 | RGB::named(WHITE), 536 | RGB::named(BLACK), 537 | ); 538 | 539 | let commands = [ 540 | (GREEN, "M"), 541 | (YELLOW, "S"), 542 | (RED, "A"), 543 | (BLACK, ""), 544 | (ORANGE, "H"), 545 | (BLACK, ""), 546 | (BLUE, "B"), 547 | ]; 548 | for (index, (color, letter)) in commands.iter().enumerate() { 549 | ctx.print_color( 550 | self.window_size.0 as usize - 4 + index % 3, 551 | self.window_size.1 as usize - 4 + index / 3, 552 | RGB::named(*color), 553 | RGB::named(BLACK), 554 | letter, 555 | ); 556 | } 557 | 558 | if self.mouse.y() > self.window_size.1 as i32 - 5 { 559 | self.mouse.print_cursor(ctx, self.mode, self.tic); 560 | } 561 | } 562 | 563 | fn render_cells(&mut self, ctx: &mut BTerm) { 564 | let mut query = <(Write, Write)>::query(); 565 | 566 | for (cell, unit) in query.iter_mut(&mut self.world) { 567 | if Rect::with_exact( 568 | -self.offset.0, 569 | -self.offset.1, 570 | self.window_size.0 as i32 - self.offset.0, 571 | self.window_size.1 as i32 - self.offset.1, 572 | ) 573 | .point_in_rect(cell.point()) 574 | { 575 | ctx.print_color( 576 | cell.x() + self.offset.0, 577 | cell.y() + self.offset.1, 578 | if self.mouse.x() - self.offset.0 == cell.x() 579 | && self.mouse.y() - self.offset.1 == cell.y() 580 | { 581 | cell.color_bright() 582 | } else { 583 | cell.color() 584 | }, 585 | cell.bg_color(), 586 | &cell.symbol().to_string(), 587 | ); 588 | } 589 | 590 | cell.update(self.dt, unit.speed()); 591 | unit.tic(self.dt); 592 | } 593 | } 594 | 595 | fn load_ctrl_group(&mut self) { 596 | let mut query = <(Write,)>::query(); 597 | 598 | for chunk in query.iter_chunks_mut(&mut self.world) { 599 | for (e, (cell,)) in chunk.into_iter_entities() { 600 | if self.selected.contains(&e) { 601 | cell.select(); 602 | } else { 603 | cell.deselect(); 604 | } 605 | } 606 | } 607 | } 608 | 609 | fn select_cells(&mut self) { 610 | let mut query = <(Write,)>::query(); 611 | 612 | if self.mode != Mode::Add { 613 | self.selected = Vec::new(); 614 | } 615 | 616 | if self.mouse.select_one() { 617 | for chunk in query.iter_chunks_mut(&mut self.world) { 618 | for (e, (cell,)) in chunk.into_iter_entities() { 619 | if self.mouse.x() == cell.x() + self.offset.0 620 | && self.mouse.y() == cell.y() + self.offset.1 621 | { 622 | cell.select(); 623 | self.selected.push(e); 624 | } else if self.mode != Mode::Add { 625 | cell.deselect(); 626 | } 627 | } 628 | } 629 | } else { 630 | for chunk in query.iter_chunks_mut(&mut self.world) { 631 | for (e, (cell,)) in chunk.into_iter_entities() { 632 | if self 633 | .mouse 634 | .point_in_selection(cell.x() + self.offset.0, cell.y() + self.offset.1) 635 | { 636 | cell.select(); 637 | self.selected.push(e); 638 | } else if self.mode != Mode::Add { 639 | cell.deselect(); 640 | } 641 | } 642 | } 643 | } 644 | 645 | self.mode = Mode::Select; 646 | } 647 | 648 | fn select_same(&mut self) { 649 | let mut query = <(Write, Read)>::query(); 650 | 651 | self.selected = Vec::new(); 652 | 653 | let mut kind = None; 654 | 655 | if self.mouse.select_one() { 656 | for (cell, unit) in query.iter_mut(&mut self.world) { 657 | if self.mouse.x() == cell.x() + self.offset.0 658 | && self.mouse.y() == cell.y() + self.offset.1 659 | { 660 | kind = Some(unit.kind()); 661 | break; 662 | } 663 | } 664 | } 665 | if let Some(kind) = kind { 666 | for chunk in query.iter_chunks_mut(&mut self.world) { 667 | for (e, (cell, unit)) in chunk.into_iter_entities() { 668 | if kind == unit.kind() 669 | && cell.x() + self.offset.0 > 0 670 | && cell.y() + self.offset.1 > 0 671 | && cell.x() + self.offset.0 < self.window_size.0 as i32 672 | && cell.y() + self.offset.1 < self.window_size.1 as i32 673 | { 674 | cell.select(); 675 | self.selected.push(e); 676 | } else { 677 | cell.deselect(); 678 | } 679 | } 680 | } 681 | } 682 | 683 | self.mode = Mode::Select; 684 | } 685 | 686 | fn move_cells(&mut self, mode: Mode) { 687 | let mut query = <(Write, Write)>::query(); 688 | 689 | for (cell, _) in query.iter_mut(&mut self.world) { 690 | if cell.selected() { 691 | cell.move_pos( 692 | Point::new( 693 | self.mouse.x() - self.offset.0, 694 | self.mouse.y() - self.offset.1, 695 | ), 696 | mode, 697 | ); 698 | } 699 | } 700 | } 701 | 702 | fn stop_cells(&mut self) { 703 | let mut query = <(Write, Write)>::query(); 704 | 705 | for (cell, _) in query.iter_mut(&mut self.world) { 706 | if cell.selected() { 707 | cell.stop_moving(); 708 | } 709 | } 710 | } 711 | 712 | fn hold_cells(&mut self) { 713 | let mut query = <(Write, Write)>::query(); 714 | 715 | for (cell, _) in query.iter_mut(&mut self.world) { 716 | if cell.selected() { 717 | cell.hold(); 718 | } 719 | } 720 | } 721 | 722 | fn focus_cell(&mut self) { 723 | let mut query = <(Write, Write)>::query(); 724 | for (cell, _) in query.iter_mut(&mut self.world) { 725 | if cell.selected() { 726 | let x = -cell.x() + self.window_size.0 as i32 / 2; 727 | let x = if x < self.map.lower_x() { 728 | self.map.lower_x() 729 | } else if x > self.map.upper_x() { 730 | self.map.upper_x() 731 | } else { 732 | x 733 | }; 734 | let y = -cell.y() + self.window_size.1 as i32 / 2; 735 | let y = if y < self.map.lower_y() { 736 | self.map.lower_y() 737 | } else if y > self.map.upper_y() { 738 | self.map.upper_y() 739 | } else { 740 | y 741 | }; 742 | 743 | self.offset = (x, y); 744 | } 745 | } 746 | } 747 | 748 | fn quit_state(&mut self, ctx: &mut BTerm) { 749 | ctx.print(5, 5, "Are you sure you want to quit? (y/n)"); 750 | 751 | if let Some(VirtualKeyCode::Y) = ctx.key { 752 | ctx.quit(); 753 | } else if let Some(VirtualKeyCode::N) = ctx.key { 754 | self.curr_state = CurrentState::Playing; 755 | } 756 | } 757 | 758 | #[cfg(target_arch = "wasm32")] 759 | fn update_dt(&self) {} 760 | #[cfg(not(target_arch = "wasm32"))] 761 | fn update_dt(&mut self) { 762 | self.dt = Instant::now().duration_since(self.instant).as_secs_f32(); 763 | self.instant = Instant::now(); 764 | } 765 | 766 | #[cfg(target_arch = "wasm32")] 767 | fn get_input(&mut self) { 768 | self.mouse.pressed.2 = false; 769 | 770 | let mut input = INPUT.lock(); 771 | 772 | input.for_each_message(|event| match event { 773 | BEvent::MouseButtonUp { button } => { 774 | self.mouse.pressed = (button, false, self.mouse.pressed.1) 775 | } 776 | BEvent::MouseButtonDown { button } => { 777 | self.mouse.pressed = (button, true, self.mouse.pressed.1) 778 | } 779 | _ => (), 780 | }); 781 | 782 | if !self.mouse.pressed.1 && self.mouse.was_pressed() { 783 | self.mouse.click = Some((self.mouse.pressed.0, false)) 784 | } 785 | } 786 | #[cfg(not(target_arch = "wasm32"))] 787 | fn get_input(&mut self) { 788 | let mut input = INPUT.lock(); 789 | 790 | input.for_each_message(|event| match event { 791 | BEvent::MouseClick { button, pressed } => self.mouse.click = Some((button, pressed)), 792 | BEvent::MouseButtonUp { button } => self.mouse.pressed = (button, false, false), 793 | BEvent::MouseButtonDown { button } => self.mouse.pressed = (button, true, false), 794 | _ => (), 795 | }); 796 | } 797 | } 798 | 799 | impl GameState for State { 800 | fn tick(&mut self, ctx: &mut BTerm) { 801 | self.update_dt(); 802 | 803 | ctx.cls(); 804 | 805 | self.get_input(); 806 | 807 | self.tic += 4; 808 | if self.tic > 99 { 809 | self.tic = 0; 810 | } 811 | 812 | self.mouse.point = ctx.mouse_point(); 813 | 814 | match self.curr_state { 815 | CurrentState::Menu => self.menu_state(ctx), 816 | CurrentState::Playing => self.play_state(ctx), 817 | CurrentState::Quitting => self.quit_state(ctx), 818 | } 819 | 820 | self.mouse.click = None; 821 | } 822 | } 823 | -------------------------------------------------------------------------------- /src/types/ctrlgroups.rs: -------------------------------------------------------------------------------- 1 | use legion::*; 2 | 3 | pub struct CtrlGroups { 4 | groups: Vec>, 5 | camera: Vec<(i32, i32)>, 6 | } 7 | 8 | impl CtrlGroups { 9 | pub fn new() -> Self { 10 | Self { 11 | groups: vec![Vec::new(); 10], 12 | camera: vec![(0, 0); 3], 13 | } 14 | } 15 | 16 | pub fn bind(&mut self, index: usize, units: Vec) { 17 | self.groups[index] = units; 18 | } 19 | 20 | pub fn add_to(&mut self, index: usize, units: &mut Vec) { 21 | self.groups[index].append(units); 22 | } 23 | 24 | pub fn group(&self, index: usize) -> Option<&Vec> { 25 | self.groups.get(index) 26 | } 27 | 28 | pub fn set_cam(&mut self, index: usize, offset: (i32, i32)) { 29 | self.camera[index] = offset; 30 | } 31 | 32 | pub fn cam(&self, index: usize) -> (i32, i32) { 33 | self.camera[index] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/types/direction.rs: -------------------------------------------------------------------------------- 1 | pub enum Direction { 2 | N, 3 | S, 4 | E, 5 | W, 6 | } 7 | -------------------------------------------------------------------------------- /src/types/kind.rs: -------------------------------------------------------------------------------- 1 | #[derive(Copy, Clone, Debug, PartialEq)] 2 | pub enum UnitKind { 3 | Trooper, 4 | FleshSpider, 5 | Blademaster, 6 | Strider, 7 | } 8 | -------------------------------------------------------------------------------- /src/types/map.rs: -------------------------------------------------------------------------------- 1 | pub struct Map { 2 | w: i32, 3 | h: i32, 4 | } 5 | 6 | impl Map { 7 | pub fn new(w: i32, h: i32) -> Self { 8 | Self { w, h } 9 | } 10 | 11 | pub fn lower_x(&self) -> i32 { 12 | -(self.w / 2) 13 | } 14 | pub fn upper_x(&self) -> i32 { 15 | self.w / 2 16 | } 17 | pub fn lower_y(&self) -> i32 { 18 | -(self.h / 2) 19 | } 20 | pub fn upper_y(&self) -> i32 { 21 | self.h / 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/types/mod.rs: -------------------------------------------------------------------------------- 1 | mod ctrlgroups; 2 | mod direction; 3 | mod kind; 4 | mod map; 5 | mod mode; 6 | mod mouse; 7 | mod race; 8 | 9 | pub use ctrlgroups::CtrlGroups; 10 | pub use direction::Direction; 11 | pub use kind::UnitKind; 12 | pub use map::Map; 13 | pub use mode::Mode; 14 | pub use mouse::Mouse; 15 | pub use race::Race; 16 | -------------------------------------------------------------------------------- /src/types/mode.rs: -------------------------------------------------------------------------------- 1 | #[derive(Copy, Clone, Debug, PartialEq)] 2 | pub enum Mode { 3 | Select, 4 | Move, 5 | Attack, 6 | Hold, 7 | Build, 8 | Ctrl, 9 | Add, 10 | } 11 | -------------------------------------------------------------------------------- /src/types/mouse.rs: -------------------------------------------------------------------------------- 1 | use bracket_lib::prelude::*; 2 | 3 | use crate::types::Mode; 4 | 5 | pub struct Mouse { 6 | pub point: Point, 7 | pub click: Option<(usize, bool)>, 8 | pub pressed: (usize, bool, bool), 9 | cursor: String, 10 | pub selection: Rect, 11 | } 12 | 13 | impl Mouse { 14 | pub fn new() -> Self { 15 | Self { 16 | point: Point::new(0, 0), 17 | click: None, 18 | pressed: (0, false, false), 19 | cursor: String::from("<"), 20 | selection: Rect::default(), 21 | } 22 | } 23 | 24 | pub fn print_cursor(&self, ctx: &mut BTerm, mode: Mode, tic: u8) { 25 | ctx.print_color( 26 | self.x(), 27 | self.y(), 28 | if let Mode::Attack = mode { 29 | RGB::named((155 + tic, 0, 0)) 30 | } else { 31 | RGB::named((0, 155 + tic, 0)) 32 | }, 33 | RGB::new(), 34 | &self.cursor, 35 | ); 36 | } 37 | 38 | pub fn select_one(&self) -> bool { 39 | self.selection.width() == 0 && self.selection.height() == 0 40 | } 41 | pub fn point_in_selection(&self, px: i32, py: i32) -> bool { 42 | let x = if self.selection.x1 <= self.selection.x2 { 43 | self.selection.x1 44 | } else { 45 | self.selection.x2 46 | }; 47 | let y = if self.selection.y1 <= self.selection.y2 { 48 | self.selection.y1 49 | } else { 50 | self.selection.y2 51 | }; 52 | 53 | Rect::with_size( 54 | x, 55 | y, 56 | self.selection.width() + 1, 57 | self.selection.height() + 1, 58 | ) 59 | .point_in_rect(Point::new(px, py)) 60 | } 61 | 62 | pub fn x(&self) -> i32 { 63 | self.point.x 64 | } 65 | pub fn y(&self) -> i32 { 66 | self.point.y 67 | } 68 | 69 | pub fn left_pressed(&self) -> bool { 70 | self.pressed.0 == 0 71 | } 72 | pub fn is_pressed(&self) -> bool { 73 | self.pressed.1 74 | } 75 | #[cfg(target_arch = "wasm32")] 76 | pub fn was_pressed(&self) -> bool { 77 | self.pressed.2 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/types/race.rs: -------------------------------------------------------------------------------- 1 | /// An enum representing the different Races a Unit can be 2 | #[derive(Copy, Clone, Debug, PartialEq)] 3 | pub enum Race { 4 | Alien, 5 | Bug, 6 | Bionic, 7 | } 8 | --------------------------------------------------------------------------------