why did I make this generic over rng anyway its not like I was ever gonna use that
This commit is contained in:
parent
62387366e4
commit
e5f13b6cb7
@ -112,7 +112,7 @@ pub struct ItemDrop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub struct DropTable<R: Rng + SeedableRng> {
|
pub struct DropTable {
|
||||||
monster_stats: HashMap<MonsterType, MonsterDropStats>,
|
monster_stats: HashMap<MonsterType, MonsterDropStats>,
|
||||||
rare_table: RareDropTable,
|
rare_table: RareDropTable,
|
||||||
weapon_table: GenericWeaponTable,
|
weapon_table: GenericWeaponTable,
|
||||||
@ -121,11 +121,11 @@ pub struct DropTable<R: Rng + SeedableRng> {
|
|||||||
unit_table: GenericUnitTable,
|
unit_table: GenericUnitTable,
|
||||||
tool_table: ToolTable,
|
tool_table: ToolTable,
|
||||||
box_table: BoxDropTable,
|
box_table: BoxDropTable,
|
||||||
rng: R,
|
rng: rand_chacha::ChaCha20Rng,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R: Rng + SeedableRng> DropTable<R> {
|
impl DropTable {
|
||||||
pub fn new(episode: Episode, difficulty: Difficulty, section_id: SectionID) -> DropTable<R> {
|
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");
|
let monster_stats: HashMap<String, MonsterDropStats> = load_data_file(episode, difficulty, section_id, "monster_dar.toml");
|
||||||
|
|
||||||
DropTable {
|
DropTable {
|
||||||
@ -137,7 +137,7 @@ impl<R: Rng + SeedableRng> DropTable<R> {
|
|||||||
unit_table: GenericUnitTable::new(episode, difficulty, section_id),
|
unit_table: GenericUnitTable::new(episode, difficulty, section_id),
|
||||||
tool_table: ToolTable::new(episode, difficulty, section_id),
|
tool_table: ToolTable::new(episode, difficulty, section_id),
|
||||||
box_table: BoxDropTable::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,
|
let section_id = vec![SectionID::Viridia, SectionID::Greenill, SectionID::Skyly, SectionID::Bluefull, SectionID::Purplenum,
|
||||||
SectionID::Pinkal, SectionID::Redria, SectionID::Oran, SectionID::Yellowboze, SectionID::Whitill]
|
SectionID::Pinkal, SectionID::Redria, SectionID::Oran, SectionID::Yellowboze, SectionID::Whitill]
|
||||||
.into_iter().choose(&mut rng).unwrap();
|
.into_iter().choose(&mut rng).unwrap();
|
||||||
DropTable::<rand_chacha::ChaCha20Rng>::new(episode, difficulty, section_id);
|
DropTable::new(episode, difficulty, section_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ pub struct RoomState {
|
|||||||
pub name: String,
|
pub name: String,
|
||||||
pub password: [u16; 16],
|
pub password: [u16; 16],
|
||||||
pub maps: Maps,
|
pub maps: Maps,
|
||||||
pub drop_table: Box<DropTable<rand_chacha::ChaCha20Rng>>,
|
pub drop_table: Box<DropTable>,
|
||||||
pub section_id: SectionID,
|
pub section_id: SectionID,
|
||||||
pub random_seed: u32,
|
pub random_seed: u32,
|
||||||
pub bursting: bool,
|
pub bursting: bool,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user