Skip to main content

Module simulate

Module simulate 

Source
Expand description

This simulator is based on Ernest Koguc’s simulator (https://github.com/ernest-koguc/sf-simulator). Minor changes have been done to bridge the gap of the original garbage collected and object oriented design of the original into rust, but otherwise, this is a direct port. As such, all credit for this implementation, goes directly to him. Apart from this, HafisCZ’s sf-tools (https://github.com/HafisCZ/sf-tools) must also be credited. Sf-tools predates Ernest Koguc’s sim and was/is used as a reference, both for results and code. The dungeon data used in the simulations has also been imported and converted directly from that source

Structs§

DamageRange
ElementIter
An iterator over the variants of Element
FightSimulationResult
Fighter
Contains all information, that is necessary for battles to be simulated. It is derived by converting any of the things that can fight (player, companion, etc.) to a fighter through the From traits. Contains all information, that is necessary for battles to be simulated. It is derived by converting any of the things that can fight (player, companion, etc.) to a fighter through the From traits. Further information is available on the simulate_battle function.
Monster
MonsterRunes
PlayerFighterSquad
UpgradeableFighter
Weapon
All the information about a weapon, that is relevant for battle simulations

Enums§

Element

Functions§

simulate_battle
Simulates iterations many fights between both sides. The returned result will be from the perspective of the left side. A win ratio of 1.0 will mean, the left side win all fights.