summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 01c8fbb..3bac285 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,7 @@
mod card;
mod grid;
use crate::card::*;
+use crate::card::cardlist::*;
use crate::card::card::Card;
use crate::grid::*;
use rand::Rng;
@@ -11,7 +12,7 @@ fn rand_u8() -> u8 {
}
fn special_000() {
- println!("Hello, world!");
+ println!("Hello!");
}
#[allow(unused_variables)]
@@ -25,19 +26,26 @@ fn main() {
card.n = 254;
card.effect = Some(effect::CardEffect {
name: "Say Hello",
+ description: "Tells the Opponent 'Hello'",
when: card::effect::CardEffectStates::default(),
- fun: &special_000,
+ handle: &special_000,
});
println!("{:?}", card);
card.randomize();
println!("{:?}", card);
if let Some(effect) = card.effect {
- (effect.fun)();
+ (effect.handle)();
}
let mut grid = Grid::<4>::default();
println!("{:?}", grid);
grid.field[0][1] = Some(card);
+ grid.field[0][2] = Some(CARD_0000);
println!("{:?}", grid);
+ if let Some(gcard) = grid.field[0][2] {
+ if let Some(effect) = gcard.effect {
+ (effect.handle)();
+ }
+ }
grid.randomize();
println!("{:?}", grid);
}