Database and testing framework for Super Auto Pets.
Game information is queried from the Super Auto Pets Fandom wiki page and stored in a SQLite
database.
```rust use saptest::{Pet, PetName, PetCombat, Food, FoodName, Team, Position};
// Create pets. let pet = Pet::tryfrom(PetName::Ant).unwrap(); let enemypet = Pet::try_from(PetName::Ant).unwrap();
// Create a team. let mut team = Team::new(&vec![pet; 5], 5).unwrap(); let mut enemyteam = Team::new(&vec![enemypet; 5], 5).unwrap();
// Give food to pets. team.setitem(Position::First, Food::tryfrom(FoodName::Garlic).ok()); enemyteam.setitem(Position::First, Food::try_from(FoodName::Garlic).ok());
// And fight as a team. team.fight(&mut enemy_team); ```
Benchmarks for saptest
are located in benches/battle_benchmarks.rs
and run using the criterion
crate.
* Compared against sapai
, a Super Auto Pets testing framework written in Python.
* Both tests were run on an AMD Ryzen 5 5600 6-Core Processor @ 3.50 GHz.
```bash
cargo bench && open target/criterion/sapai_example/report/index.html ```
```bash
cd benches/ git clone https://github.com/manny405/sapai.git && cd sapai python setup.py install
battle_benchmarks_sapai.ipynb
.```
To enable verbose logging to troubleshoot issues, enable log4rs
and use the main log config file.
```rust
fn main() { log4rs::initfile("config/logconfig.yaml", Default::default()).unwrap();
// Code here. ... } ```