mirror of https://github.com/Paoda/blue-gacha.git
feat: ensure tests pass
This commit is contained in:
parent
aa68942d84
commit
0474f59ac4
|
@ -1,7 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "ba-gacha"
|
||||
name = "bluearch-recruitment"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"rand",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "ba-gacha"
|
||||
name = "bluearch-recruitment"
|
||||
version = "0.1.0"
|
||||
authors = ["Rekai Musuka <rekai@musuka.dev>"]
|
||||
edition = "2018"
|
||||
|
|
|
@ -21,7 +21,7 @@ impl BannerBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::banner::BannerBuilder;
|
||||
/// # use bluearch_recruitment::banner::BannerBuilder;
|
||||
/// let banner_builder = BannerBuilder::new("ピックアップ募集");
|
||||
/// ```
|
||||
pub fn new(jpn_name: &str) -> Self {
|
||||
|
@ -39,8 +39,8 @@ impl BannerBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::banner::BannerBuilder;
|
||||
/// # use ba_gacha::i18n::Language;
|
||||
/// # use bluearch_recruitment::banner::BannerBuilder;
|
||||
/// # use bluearch_recruitment::i18n::Language;
|
||||
/// let banner_builder = BannerBuilder::new("ピックアップ募集")
|
||||
/// .with_name_translation(Language::English, "Focus Recruitment");
|
||||
/// ```
|
||||
|
@ -56,8 +56,8 @@ impl BannerBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::GachaBuilder;
|
||||
/// # use ba_gacha::banner::BannerBuilder;
|
||||
/// # use bluearch_recruitment::gacha::GachaBuilder;
|
||||
/// # use bluearch_recruitment::banner::BannerBuilder;
|
||||
/// let gacha = GachaBuilder::default()
|
||||
/// .with_pool(Vec::new())
|
||||
/// .finish().unwrap();
|
||||
|
@ -79,7 +79,12 @@ impl BannerBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::banner::BannerBuilder;
|
||||
/// # use bluearch_recruitment::student::Student;
|
||||
/// # use bluearch_recruitment::banner::BannerBuilder;
|
||||
/// let students = Vec::new();
|
||||
/// let banner_builder = BannerBuilder::new("ピックアップ募集")
|
||||
/// .with_sparkable_students(&students);
|
||||
/// ```
|
||||
pub fn with_sparkable_students(self, students: &[Student]) -> Self {
|
||||
Self {
|
||||
sparkable: Some(students.to_vec()),
|
||||
|
|
22
src/gacha.rs
22
src/gacha.rs
|
@ -67,7 +67,7 @@ impl GachaBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::GachaBuilder;
|
||||
/// # use bluearch_recruitment::gacha::GachaBuilder;
|
||||
/// let gacha_builder: GachaBuilder = GachaBuilder::new(79.0, 18.5, 2.5)
|
||||
/// .with_pool(Vec::new());
|
||||
/// ```
|
||||
|
@ -91,8 +91,8 @@ impl GachaBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::{GachaBuilder, Rarity};
|
||||
/// # use ba_gacha::student::Student;
|
||||
/// # use bluearch_recruitment::gacha::{GachaBuilder, Rarity};
|
||||
/// # use bluearch_recruitment::student::Student;
|
||||
///
|
||||
/// let aru = Student::new("アル", Rarity::Three);
|
||||
/// let hina = Student::new("ヒナ", Rarity::Three);
|
||||
|
@ -113,13 +113,15 @@ impl GachaBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::{GachaBuilder, Rarity};
|
||||
/// # use ba_gacha::student::Student;
|
||||
/// # use bluearch_recruitment::gacha::{GachaBuilder, Rarity};
|
||||
/// # use bluearch_recruitment::student::Student;
|
||||
/// let aru = Student::new("アル", Rarity::Three);
|
||||
/// let hina = Student::new("ヒナ", Rarity::Three);
|
||||
/// let rate_up = vec![aru, hina.clone()];
|
||||
/// let priority = vec![hina];
|
||||
/// let gacha_builder = GachaBuilder::new(79.0, 18.5, 2.5)
|
||||
/// .with_pool(vec![aru, hina.clone()])
|
||||
/// .with_priority(vec![hina], 3.5);
|
||||
/// .with_pool(rate_up)
|
||||
/// .with_priority(&priority, 3.5);
|
||||
/// ```
|
||||
pub fn with_priority(self, students: &[Student], total_rate: f32) -> Self {
|
||||
Self {
|
||||
|
@ -135,8 +137,8 @@ impl GachaBuilder {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::{GachaBuilder, Gacha, Rarity};
|
||||
/// # use ba_gacha::student::Student;
|
||||
/// # use bluearch_recruitment::gacha::{GachaBuilder, Gacha, Rarity};
|
||||
/// # use bluearch_recruitment::student::Student;
|
||||
/// let aru = Student::new("アル", Rarity::Three);
|
||||
/// let hina = Student::new("ヒナ", Rarity::Three);
|
||||
/// let gacha = GachaBuilder::default()
|
||||
|
@ -171,7 +173,7 @@ impl Gacha {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::{GachaBuilder, Rarity};
|
||||
/// # use bluearch_recruitment::gacha::{GachaBuilder, Rarity};
|
||||
/// let gacha = GachaBuilder::new(79.0, 18.5, 2.5)
|
||||
/// .with_pool(Vec::new())
|
||||
/// .finish()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use ba_gacha::banner::BannerBuilder;
|
||||
use ba_gacha::gacha::{GachaBuilder, Recruitment};
|
||||
use ba_gacha::i18n::Language;
|
||||
use ba_gacha::student::Student;
|
||||
use bluearch_recruitment::banner::BannerBuilder;
|
||||
use bluearch_recruitment::gacha::{GachaBuilder, Recruitment};
|
||||
use bluearch_recruitment::i18n::Language;
|
||||
use bluearch_recruitment::student::Student;
|
||||
use std::{fs::File, io::Read};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -25,8 +25,8 @@ impl Student {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::Rarity;
|
||||
/// # use ba_gacha::student::Student;
|
||||
/// # use bluearch_recruitment::gacha::Rarity;
|
||||
/// # use bluearch_recruitment::student::Student;
|
||||
///
|
||||
/// let mutsuki = Student::new("ムツキ", Rarity::Two);
|
||||
/// ```
|
||||
|
@ -45,9 +45,9 @@ impl Student {
|
|||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// # use ba_gacha::gacha::Rarity;
|
||||
/// # use ba_gacha::student::Student;
|
||||
/// # use ba_gacha::i18n::Language;
|
||||
/// # use bluearch_recruitment::gacha::Rarity;
|
||||
/// # use bluearch_recruitment::student::Student;
|
||||
/// # use bluearch_recruitment::i18n::Language;
|
||||
///
|
||||
/// let mut mutsuki = Student::new("ムツキ", Rarity::Two);
|
||||
/// mutsuki.add_translation(Language::English, "Mutsuki");
|
||||
|
|
Loading…
Reference in New Issue