A card game engine for TCGs, primarily Magic: The Gathering but with support for others
0
fork

Configure Feed

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

Switching to Go

+27 -766
+27 -1
.gitignore
··· 1 - /target 1 + # Created by https://www.toptal.com/developers/gitignore/api/go 2 + # Edit at https://www.toptal.com/developers/gitignore?templates=go 3 + 4 + ### Go ### 5 + # If you prefer the allow list template instead of the deny list, see community template: 6 + # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 7 + # 8 + # Binaries for programs and plugins 9 + *.exe 10 + *.exe~ 11 + *.dll 12 + *.so 13 + *.dylib 14 + 15 + # Test binary, built with `go test -c` 16 + *.test 17 + 18 + # Output of the go coverage tool, specifically when used with LiteIDE 19 + *.out 20 + 21 + # Dependency directories (remove the comment below to include it) 22 + # vendor/ 23 + 24 + # Go workspace file 25 + go.work 26 + 27 + # End of https://www.toptal.com/developers/gitignore/api/go
-561
Cargo.lock
··· 1 - # This file is automatically @generated by Cargo. 2 - # It is not intended for manual editing. 3 - version = 4 4 - 5 - [[package]] 6 - name = "anyhow" 7 - version = "1.0.102" 8 - source = "registry+https://github.com/rust-lang/crates.io-index" 9 - checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" 10 - 11 - [[package]] 12 - name = "bitflags" 13 - version = "2.11.1" 14 - source = "registry+https://github.com/rust-lang/crates.io-index" 15 - checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" 16 - 17 - [[package]] 18 - name = "bumpalo" 19 - version = "3.20.2" 20 - source = "registry+https://github.com/rust-lang/crates.io-index" 21 - checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" 22 - 23 - [[package]] 24 - name = "cc" 25 - version = "1.2.60" 26 - source = "registry+https://github.com/rust-lang/crates.io-index" 27 - checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" 28 - dependencies = [ 29 - "find-msvc-tools", 30 - "shlex", 31 - ] 32 - 33 - [[package]] 34 - name = "cfg-if" 35 - version = "1.0.4" 36 - source = "registry+https://github.com/rust-lang/crates.io-index" 37 - checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 38 - 39 - [[package]] 40 - name = "chacha20" 41 - version = "0.10.0" 42 - source = "registry+https://github.com/rust-lang/crates.io-index" 43 - checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" 44 - dependencies = [ 45 - "cfg-if", 46 - "cpufeatures", 47 - "rand_core", 48 - ] 49 - 50 - [[package]] 51 - name = "cpufeatures" 52 - version = "0.3.0" 53 - source = "registry+https://github.com/rust-lang/crates.io-index" 54 - checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" 55 - dependencies = [ 56 - "libc", 57 - ] 58 - 59 - [[package]] 60 - name = "equivalent" 61 - version = "1.0.2" 62 - source = "registry+https://github.com/rust-lang/crates.io-index" 63 - checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 64 - 65 - [[package]] 66 - name = "find-msvc-tools" 67 - version = "0.1.9" 68 - source = "registry+https://github.com/rust-lang/crates.io-index" 69 - checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" 70 - 71 - [[package]] 72 - name = "foldhash" 73 - version = "0.1.5" 74 - source = "registry+https://github.com/rust-lang/crates.io-index" 75 - checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" 76 - 77 - [[package]] 78 - name = "getrandom" 79 - version = "0.4.2" 80 - source = "registry+https://github.com/rust-lang/crates.io-index" 81 - checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" 82 - dependencies = [ 83 - "cfg-if", 84 - "libc", 85 - "r-efi", 86 - "rand_core", 87 - "wasip2", 88 - "wasip3", 89 - ] 90 - 91 - [[package]] 92 - name = "hashbrown" 93 - version = "0.15.5" 94 - source = "registry+https://github.com/rust-lang/crates.io-index" 95 - checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" 96 - dependencies = [ 97 - "foldhash", 98 - ] 99 - 100 - [[package]] 101 - name = "hashbrown" 102 - version = "0.17.0" 103 - source = "registry+https://github.com/rust-lang/crates.io-index" 104 - checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" 105 - 106 - [[package]] 107 - name = "heck" 108 - version = "0.5.0" 109 - source = "registry+https://github.com/rust-lang/crates.io-index" 110 - checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 111 - 112 - [[package]] 113 - name = "id-arena" 114 - version = "2.3.0" 115 - source = "registry+https://github.com/rust-lang/crates.io-index" 116 - checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" 117 - 118 - [[package]] 119 - name = "indexmap" 120 - version = "2.14.0" 121 - source = "registry+https://github.com/rust-lang/crates.io-index" 122 - checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" 123 - dependencies = [ 124 - "equivalent", 125 - "hashbrown 0.17.0", 126 - "serde", 127 - "serde_core", 128 - ] 129 - 130 - [[package]] 131 - name = "itoa" 132 - version = "1.0.18" 133 - source = "registry+https://github.com/rust-lang/crates.io-index" 134 - checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" 135 - 136 - [[package]] 137 - name = "js-sys" 138 - version = "0.3.95" 139 - source = "registry+https://github.com/rust-lang/crates.io-index" 140 - checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" 141 - dependencies = [ 142 - "once_cell", 143 - "wasm-bindgen", 144 - ] 145 - 146 - [[package]] 147 - name = "leb128fmt" 148 - version = "0.1.0" 149 - source = "registry+https://github.com/rust-lang/crates.io-index" 150 - checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" 151 - 152 - [[package]] 153 - name = "libc" 154 - version = "0.2.185" 155 - source = "registry+https://github.com/rust-lang/crates.io-index" 156 - checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" 157 - 158 - [[package]] 159 - name = "log" 160 - version = "0.4.29" 161 - source = "registry+https://github.com/rust-lang/crates.io-index" 162 - checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 163 - 164 - [[package]] 165 - name = "managrove" 166 - version = "0.1.0" 167 - dependencies = [ 168 - "rand", 169 - "sqlite3", 170 - "uuid", 171 - ] 172 - 173 - [[package]] 174 - name = "memchr" 175 - version = "2.8.0" 176 - source = "registry+https://github.com/rust-lang/crates.io-index" 177 - checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" 178 - 179 - [[package]] 180 - name = "once_cell" 181 - version = "1.21.4" 182 - source = "registry+https://github.com/rust-lang/crates.io-index" 183 - checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" 184 - 185 - [[package]] 186 - name = "pkg-config" 187 - version = "0.3.33" 188 - source = "registry+https://github.com/rust-lang/crates.io-index" 189 - checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" 190 - 191 - [[package]] 192 - name = "prettyplease" 193 - version = "0.2.37" 194 - source = "registry+https://github.com/rust-lang/crates.io-index" 195 - checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" 196 - dependencies = [ 197 - "proc-macro2", 198 - "syn", 199 - ] 200 - 201 - [[package]] 202 - name = "proc-macro2" 203 - version = "1.0.106" 204 - source = "registry+https://github.com/rust-lang/crates.io-index" 205 - checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" 206 - dependencies = [ 207 - "unicode-ident", 208 - ] 209 - 210 - [[package]] 211 - name = "quote" 212 - version = "1.0.45" 213 - source = "registry+https://github.com/rust-lang/crates.io-index" 214 - checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" 215 - dependencies = [ 216 - "proc-macro2", 217 - ] 218 - 219 - [[package]] 220 - name = "r-efi" 221 - version = "6.0.0" 222 - source = "registry+https://github.com/rust-lang/crates.io-index" 223 - checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" 224 - 225 - [[package]] 226 - name = "rand" 227 - version = "0.10.1" 228 - source = "registry+https://github.com/rust-lang/crates.io-index" 229 - checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" 230 - dependencies = [ 231 - "chacha20", 232 - "getrandom", 233 - "rand_core", 234 - ] 235 - 236 - [[package]] 237 - name = "rand_core" 238 - version = "0.10.1" 239 - source = "registry+https://github.com/rust-lang/crates.io-index" 240 - checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" 241 - 242 - [[package]] 243 - name = "rustversion" 244 - version = "1.0.22" 245 - source = "registry+https://github.com/rust-lang/crates.io-index" 246 - checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 247 - 248 - [[package]] 249 - name = "semver" 250 - version = "1.0.28" 251 - source = "registry+https://github.com/rust-lang/crates.io-index" 252 - checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" 253 - 254 - [[package]] 255 - name = "serde" 256 - version = "1.0.228" 257 - source = "registry+https://github.com/rust-lang/crates.io-index" 258 - checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 259 - dependencies = [ 260 - "serde_core", 261 - ] 262 - 263 - [[package]] 264 - name = "serde_core" 265 - version = "1.0.228" 266 - source = "registry+https://github.com/rust-lang/crates.io-index" 267 - checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 268 - dependencies = [ 269 - "serde_derive", 270 - ] 271 - 272 - [[package]] 273 - name = "serde_derive" 274 - version = "1.0.228" 275 - source = "registry+https://github.com/rust-lang/crates.io-index" 276 - checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 277 - dependencies = [ 278 - "proc-macro2", 279 - "quote", 280 - "syn", 281 - ] 282 - 283 - [[package]] 284 - name = "serde_json" 285 - version = "1.0.149" 286 - source = "registry+https://github.com/rust-lang/crates.io-index" 287 - checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" 288 - dependencies = [ 289 - "itoa", 290 - "memchr", 291 - "serde", 292 - "serde_core", 293 - "zmij", 294 - ] 295 - 296 - [[package]] 297 - name = "shlex" 298 - version = "1.3.0" 299 - source = "registry+https://github.com/rust-lang/crates.io-index" 300 - checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 301 - 302 - [[package]] 303 - name = "sqlite3" 304 - version = "0.24.0" 305 - source = "registry+https://github.com/rust-lang/crates.io-index" 306 - checksum = "1906b10f5e1940b3f2f758992f5958f9b27abaf2e028e86fa3c42f49fb5e583c" 307 - dependencies = [ 308 - "libc", 309 - "sqlite3-sys", 310 - ] 311 - 312 - [[package]] 313 - name = "sqlite3-src" 314 - version = "0.2.12" 315 - source = "registry+https://github.com/rust-lang/crates.io-index" 316 - checksum = "b8bb25e66d026488228a97e0ad21e3d15ec5998dcd9ad73c97cc277c56a6b314" 317 - dependencies = [ 318 - "cc", 319 - "pkg-config", 320 - ] 321 - 322 - [[package]] 323 - name = "sqlite3-sys" 324 - version = "0.12.0" 325 - source = "registry+https://github.com/rust-lang/crates.io-index" 326 - checksum = "71fec807a1534bd13eeaaec396175d67c79bdc68df55e18a452726ec62a8fb08" 327 - dependencies = [ 328 - "libc", 329 - "sqlite3-src", 330 - ] 331 - 332 - [[package]] 333 - name = "syn" 334 - version = "2.0.117" 335 - source = "registry+https://github.com/rust-lang/crates.io-index" 336 - checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" 337 - dependencies = [ 338 - "proc-macro2", 339 - "quote", 340 - "unicode-ident", 341 - ] 342 - 343 - [[package]] 344 - name = "unicode-ident" 345 - version = "1.0.24" 346 - source = "registry+https://github.com/rust-lang/crates.io-index" 347 - checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" 348 - 349 - [[package]] 350 - name = "unicode-xid" 351 - version = "0.2.6" 352 - source = "registry+https://github.com/rust-lang/crates.io-index" 353 - checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 354 - 355 - [[package]] 356 - name = "uuid" 357 - version = "1.23.1" 358 - source = "registry+https://github.com/rust-lang/crates.io-index" 359 - checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" 360 - dependencies = [ 361 - "getrandom", 362 - "js-sys", 363 - "wasm-bindgen", 364 - ] 365 - 366 - [[package]] 367 - name = "wasip2" 368 - version = "1.0.3+wasi-0.2.9" 369 - source = "registry+https://github.com/rust-lang/crates.io-index" 370 - checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" 371 - dependencies = [ 372 - "wit-bindgen 0.57.1", 373 - ] 374 - 375 - [[package]] 376 - name = "wasip3" 377 - version = "0.4.0+wasi-0.3.0-rc-2026-01-06" 378 - source = "registry+https://github.com/rust-lang/crates.io-index" 379 - checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" 380 - dependencies = [ 381 - "wit-bindgen 0.51.0", 382 - ] 383 - 384 - [[package]] 385 - name = "wasm-bindgen" 386 - version = "0.2.118" 387 - source = "registry+https://github.com/rust-lang/crates.io-index" 388 - checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" 389 - dependencies = [ 390 - "cfg-if", 391 - "once_cell", 392 - "rustversion", 393 - "wasm-bindgen-macro", 394 - "wasm-bindgen-shared", 395 - ] 396 - 397 - [[package]] 398 - name = "wasm-bindgen-macro" 399 - version = "0.2.118" 400 - source = "registry+https://github.com/rust-lang/crates.io-index" 401 - checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" 402 - dependencies = [ 403 - "quote", 404 - "wasm-bindgen-macro-support", 405 - ] 406 - 407 - [[package]] 408 - name = "wasm-bindgen-macro-support" 409 - version = "0.2.118" 410 - source = "registry+https://github.com/rust-lang/crates.io-index" 411 - checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" 412 - dependencies = [ 413 - "bumpalo", 414 - "proc-macro2", 415 - "quote", 416 - "syn", 417 - "wasm-bindgen-shared", 418 - ] 419 - 420 - [[package]] 421 - name = "wasm-bindgen-shared" 422 - version = "0.2.118" 423 - source = "registry+https://github.com/rust-lang/crates.io-index" 424 - checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" 425 - dependencies = [ 426 - "unicode-ident", 427 - ] 428 - 429 - [[package]] 430 - name = "wasm-encoder" 431 - version = "0.244.0" 432 - source = "registry+https://github.com/rust-lang/crates.io-index" 433 - checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" 434 - dependencies = [ 435 - "leb128fmt", 436 - "wasmparser", 437 - ] 438 - 439 - [[package]] 440 - name = "wasm-metadata" 441 - version = "0.244.0" 442 - source = "registry+https://github.com/rust-lang/crates.io-index" 443 - checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" 444 - dependencies = [ 445 - "anyhow", 446 - "indexmap", 447 - "wasm-encoder", 448 - "wasmparser", 449 - ] 450 - 451 - [[package]] 452 - name = "wasmparser" 453 - version = "0.244.0" 454 - source = "registry+https://github.com/rust-lang/crates.io-index" 455 - checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" 456 - dependencies = [ 457 - "bitflags", 458 - "hashbrown 0.15.5", 459 - "indexmap", 460 - "semver", 461 - ] 462 - 463 - [[package]] 464 - name = "wit-bindgen" 465 - version = "0.51.0" 466 - source = "registry+https://github.com/rust-lang/crates.io-index" 467 - checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" 468 - dependencies = [ 469 - "wit-bindgen-rust-macro", 470 - ] 471 - 472 - [[package]] 473 - name = "wit-bindgen" 474 - version = "0.57.1" 475 - source = "registry+https://github.com/rust-lang/crates.io-index" 476 - checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" 477 - 478 - [[package]] 479 - name = "wit-bindgen-core" 480 - version = "0.51.0" 481 - source = "registry+https://github.com/rust-lang/crates.io-index" 482 - checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" 483 - dependencies = [ 484 - "anyhow", 485 - "heck", 486 - "wit-parser", 487 - ] 488 - 489 - [[package]] 490 - name = "wit-bindgen-rust" 491 - version = "0.51.0" 492 - source = "registry+https://github.com/rust-lang/crates.io-index" 493 - checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" 494 - dependencies = [ 495 - "anyhow", 496 - "heck", 497 - "indexmap", 498 - "prettyplease", 499 - "syn", 500 - "wasm-metadata", 501 - "wit-bindgen-core", 502 - "wit-component", 503 - ] 504 - 505 - [[package]] 506 - name = "wit-bindgen-rust-macro" 507 - version = "0.51.0" 508 - source = "registry+https://github.com/rust-lang/crates.io-index" 509 - checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" 510 - dependencies = [ 511 - "anyhow", 512 - "prettyplease", 513 - "proc-macro2", 514 - "quote", 515 - "syn", 516 - "wit-bindgen-core", 517 - "wit-bindgen-rust", 518 - ] 519 - 520 - [[package]] 521 - name = "wit-component" 522 - version = "0.244.0" 523 - source = "registry+https://github.com/rust-lang/crates.io-index" 524 - checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" 525 - dependencies = [ 526 - "anyhow", 527 - "bitflags", 528 - "indexmap", 529 - "log", 530 - "serde", 531 - "serde_derive", 532 - "serde_json", 533 - "wasm-encoder", 534 - "wasm-metadata", 535 - "wasmparser", 536 - "wit-parser", 537 - ] 538 - 539 - [[package]] 540 - name = "wit-parser" 541 - version = "0.244.0" 542 - source = "registry+https://github.com/rust-lang/crates.io-index" 543 - checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" 544 - dependencies = [ 545 - "anyhow", 546 - "id-arena", 547 - "indexmap", 548 - "log", 549 - "semver", 550 - "serde", 551 - "serde_derive", 552 - "serde_json", 553 - "unicode-xid", 554 - "wasmparser", 555 - ] 556 - 557 - [[package]] 558 - name = "zmij" 559 - version = "1.0.21" 560 - source = "registry+https://github.com/rust-lang/crates.io-index" 561 - checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
-12
Cargo.toml
··· 1 - [package] 2 - name = "managrove" 3 - version = "0.1.0" 4 - edition = "2024" 5 - 6 - [dependencies] 7 - rand = "0.10.1" 8 - sqlite3 = "0.24.0" 9 - 10 - [dependencies.uuid] 11 - version = "1.23.1" 12 - features = ["v4"]
-75
README.md
··· 1 - # ManaGrove 2 - A card game engine for TCGs, primarily Magic: The Gathering but with support for others 3 - # Roadmap 4 - ## Milestone 1: Core Data Model (Engine Skeleton) 5 - * Represent a Game State clearly 6 - * Implement data structures like `GameState`, `Player`, `CardInstance`, `Zone`, etc 7 - ## Milestone 2: Turn Structure 8 - * Implement: 9 - * Turn order 10 - * Phases: 11 - * Beginning 12 - * Pre-combat Main 13 - * Combat 14 - * Post-combat Main 15 - * Ending 16 - ## Milestone 3: Base Actions 17 - * Implement: 18 - * Draw card 19 - * Play card (only at sorcery speed) 20 - * Basic creatures 21 - * Power/Toughness 22 - * Enter battlefield 23 - ## Milestone 4: Event System 24 - * Implement 25 - * Event Enum 26 - * `CardPlayed` 27 - * `CardEnteredZone` 28 - * `PhaseStart` 29 - * etc. 30 - * Event Dispatch System 31 - * Event Listeners 32 - ## Milestone 5: Triggered Abilities 33 - * Implement 34 - * Ability structure 35 - * Trigger (e.g. on enter battlefield, on attack, etc.) 36 - * Condition 37 - * Effect 38 - * Effect System 39 - * Draw 40 - * Damage 41 - * P/T Counters 42 - ## Milestone 6: Combat System 43 - * Implement 44 - * Delcare attackers 45 - * Assign blockers 46 - * Damage resolution 47 - ## Milestone 7: The Stack/Priority 48 - * Implement 49 - * Stack (LIFO) 50 - * Stack Objects (Spells/abilities) 51 - * Priority passing between players 52 - * Resolution rules 53 - ## Milestone 8: Target System 54 - * Implement 55 - * Target types 56 - * Creature 57 - * Player 58 - * Permanent 59 - * etc. 60 - * Validation rules 61 - * Selection system 62 - ## Milestone 9: CLI-based Deck Tester 63 - * Implement 64 - * Load deck list 65 - * Draw opening hand 66 - * Step through turns 67 - * Turn step timestep, default 1 sec, can be set to None to just play through the entire game and show the winner 68 - * Print/export log of events 69 - * Simple AI (random legal moves) 70 - ## Milestone 10: Expand Card System 71 - * Add more effects 72 - * Add more triggers 73 - * Add static abilities 74 - * Add continuous effects 75 - * Add other counters (e.g. time counters)
-40
src/game/card.rs
··· 1 - use uuid::Uuid; 2 - use crate::game::{player::PlayerId, zone::ZoneId}; 3 - 4 - pub struct CardId(Uuid); 5 - pub struct CardDefId(Uuid); 6 - 7 - pub struct CardInstance { 8 - id: CardId, 9 - definition_id: CardDefId, 10 - owner: PlayerId, 11 - zone: ZoneId, 12 - tapped: bool 13 - } 14 - 15 - pub struct CardDefinition { 16 - id: CardDefId, 17 - name: String, 18 - cost: u32, 19 - // abilities: Vec<Ability> 20 - // TODO: Implement abilities later 21 - } 22 - 23 - impl CardDefinition { 24 - pub fn new(name: String, cost: u32) -> Self { 25 - Self { 26 - id: CardDefId(Uuid::new_v4()), 27 - name, 28 - cost 29 - } 30 - } 31 - } 32 - 33 - pub struct ManaPool { 34 - red: u32, 35 - blue: u32, 36 - green: u32, 37 - white: u32, 38 - black: u32, 39 - colorless: u32 40 - }
-4
src/game/mod.rs
··· 1 - pub mod player; 2 - pub mod zone; 3 - pub mod card; 4 - pub mod state;
-25
src/game/player.rs
··· 1 - use uuid::Uuid; 2 - use std::collections::HashMap; 3 - use crate::game::{zone::ZoneId, card::ManaPool}; 4 - 5 - pub struct PlayerId(Uuid); 6 - 7 - pub struct Player { 8 - id: PlayerId, 9 - life: i32, 10 - // Zones owned by this player 11 - hand: ZoneId, 12 - library: ZoneId, 13 - graveyard: ZoneId, 14 - battlefield: ZoneId, 15 - exile: ZoneId, 16 - // Gameplay state 17 - mana_pool: ManaPool, 18 - // Status effects 19 - poison_counters: u32, 20 - energy_counters: u32, 21 - rad_counters: u32, 22 - ticket_counters: u32, 23 - experience_counters: u32, 24 - special_damage: HashMap<PlayerId, u32> 25 - }
-18
src/game/state.rs
··· 1 - use crate::game::{player::{PlayerId, Player}, card::{CardId, CardInstance}, zone::{ZoneId, Zone}}; 2 - use std::collections::HashMap; 3 - 4 - pub struct TurnOrder(Vec<PlayerId>); 5 - 6 - pub enum Phase { 7 - Beginning(PlayerId), 8 - PreCombatMain(PlayerId), 9 - Combat(PlayerId), 10 - PostCombatMain(PlayerId), 11 - End(PlayerId) 12 - } 13 - 14 - pub struct GameState { 15 - players: HashMap<PlayerId, Player>, 16 - cards: HashMap<CardId, CardInstance>, 17 - zones: HashMap<ZoneId, Zone> 18 - }
-27
src/game/zone.rs
··· 1 - use uuid::Uuid; 2 - use crate::game::{player::PlayerId, card::CardId}; 3 - 4 - pub struct ZoneId(Uuid); 5 - 6 - pub struct Zone { 7 - id: ZoneId, 8 - owner: PlayerId, 9 - cards: Vec<CardId>, 10 - zone_type: ZoneType, 11 - visibility: ZoneVisibility 12 - } 13 - 14 - pub enum ZoneType { 15 - Hand, 16 - Library, 17 - Graveyard, 18 - Battlefield, 19 - Exile, 20 - Stack 21 - } 22 - 23 - pub enum ZoneVisibility { 24 - Public, 25 - HiddenToOpponent, 26 - HiddenToAll 27 - }
-3
src/main.rs
··· 1 - mod game; 2 - 3 - fn main() {}