From e5f13b6cb73d323d6ac6f35887d5380aa4f249c5 Mon Sep 17 00:00:00 2001 From: jake <jake@sharnoth.com> Date: Sun, 29 Jan 2023 11:51:55 -0700 Subject: [PATCH] why did I make this generic over rng anyway its not like I was ever gonna use that --- src/ship/drops/mod.rs | 12 ++++++------ src/ship/room.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ship/drops/mod.rs b/src/ship/drops/mod.rs index 5e9747f..e4f695d 100644 --- a/src/ship/drops/mod.rs +++ b/src/ship/drops/mod.rs @@ -112,7 +112,7 @@ pub struct ItemDrop { } -pub struct DropTable<R: Rng + SeedableRng> { +pub struct DropTable { monster_stats: HashMap<MonsterType, MonsterDropStats>, rare_table: RareDropTable, weapon_table: GenericWeaponTable, @@ -121,11 +121,11 @@ pub struct DropTable<R: Rng + SeedableRng> { unit_table: GenericUnitTable, tool_table: ToolTable, box_table: BoxDropTable, - rng: R, + rng: rand_chacha::ChaCha20Rng, } -impl<R: Rng + SeedableRng> DropTable<R> { - pub fn new(episode: Episode, difficulty: Difficulty, section_id: SectionID) -> DropTable<R> { +impl DropTable { + pub fn new(episode: Episode, difficulty: Difficulty, section_id: SectionID) -> DropTable { let monster_stats: HashMap<String, MonsterDropStats> = load_data_file(episode, difficulty, section_id, "monster_dar.toml"); DropTable { @@ -137,7 +137,7 @@ impl<R: Rng + SeedableRng> DropTable<R> { unit_table: GenericUnitTable::new(episode, difficulty, section_id), tool_table: ToolTable::new(episode, difficulty, section_id), box_table: BoxDropTable::new(episode, difficulty, section_id), - rng: R::from_entropy(), + rng: rand_chacha::ChaCha20Rng::from_entropy(), } } @@ -203,6 +203,6 @@ mod test { let section_id = vec![SectionID::Viridia, SectionID::Greenill, SectionID::Skyly, SectionID::Bluefull, SectionID::Purplenum, SectionID::Pinkal, SectionID::Redria, SectionID::Oran, SectionID::Yellowboze, SectionID::Whitill] .into_iter().choose(&mut rng).unwrap(); - DropTable::<rand_chacha::ChaCha20Rng>::new(episode, difficulty, section_id); + DropTable::new(episode, difficulty, section_id); } } diff --git a/src/ship/room.rs b/src/ship/room.rs index 523169a..31e0b87 100644 --- a/src/ship/room.rs +++ b/src/ship/room.rs @@ -310,7 +310,7 @@ pub struct RoomState { pub name: String, pub password: [u16; 16], pub maps: Maps, - pub drop_table: Box<DropTable<rand_chacha::ChaCha20Rng>>, + pub drop_table: Box<DropTable>, pub section_id: SectionID, pub random_seed: u32, pub bursting: bool,