@@ 26,6 26,13 @@ mod plugins;
mod game_status;
+#[macro_export]
+macro_rules! seed_gen {
+ () => {
+ fastrand::u64(u64::MIN..=u64::MAX)
+ };
+}
+
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, States)]
enum AppState {
#[default]
@@ 10,7 10,7 @@ use bevy::prelude::*;
use bevy_mod_picking::prelude::*;
use bevy_rapier3d::prelude::*;
-use crate::{plugins::GameActionCreateCallEvent, api::game::{Action, Command}, Global, game_status::PlayerState};
+use crate::{plugins::GameActionCreateCallEvent, api::game::{Action, Command}, Global, game_status::PlayerState, seed_gen};
use super::{
card::{visual_card_kind, VisualCard, VisualCardBundle, ClickedCard},
@@ 139,7 139,7 @@ fn handle_clicked_supply_pile(
index: card_kind.0,
for_cost: card.card.cost,
},
- fastrand::u64(u64::MIN..=u64::MAX),
+ seed_gen!(),
),
});
}
@@ 13,7 13,7 @@ use crate::{
api::game::{Action, Command, Game},
game_status::{Card, PlayerState},
plugins::{GameActionCreateCallEvent, GameDetailsCallEvent},
- AppState, Global,
+ AppState, Global, seed_gen,
};
use super::{supply::SpawnSupplyPilesEvent, GameData};
@@ 459,7 459,7 @@ fn hardcoded_init(game: &Game, create_action_ev_w: &mut EventWriter<GameActionCr
},
amount: 10,
},
- fastrand::u64(u64::MIN..=u64::MAX),
+ seed_gen!(),
),
});
create_action_ev_w.send(GameActionCreateCallEvent {
@@ 477,7 477,7 @@ fn hardcoded_init(game: &Game, create_action_ev_w: &mut EventWriter<GameActionCr
},
amount: 10,
},
- fastrand::u64(u64::MIN..=u64::MAX),
+ seed_gen!(),
),
});
create_action_ev_w.send(GameActionCreateCallEvent {
@@ 495,7 495,7 @@ fn hardcoded_init(game: &Game, create_action_ev_w: &mut EventWriter<GameActionCr
},
amount: 10,
},
- fastrand::u64(u64::MIN..=u64::MAX),
+ seed_gen!(),
),
});
create_action_ev_w.send(GameActionCreateCallEvent {
@@ 513,7 513,7 @@ fn hardcoded_init(game: &Game, create_action_ev_w: &mut EventWriter<GameActionCr
},
amount: 10,
},
- fastrand::u64(u64::MIN..=u64::MAX),
+ seed_gen!(),
),
});
@@ 526,7 526,7 @@ fn hardcoded_init(game: &Game, create_action_ev_w: &mut EventWriter<GameActionCr
&Command::ChangePlayerState {
state: PlayerState::PlayPhase,
},
- fastrand::u64(u64::MIN..=u64::MAX),
+ seed_gen!(),
),
});
}