Code Monkey home page Code Monkey logo

tseflcz / genshin_artifact Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wormtql/genshin_artifact

0.0 0.0 0.0 32.06 MB

莫娜占卜铺 | 原神 | 圣遗物搭配 | 圣遗物潜力。多方向圣遗物自动搭配,多方向圣遗物潜力与评分, Genshin Impact artifacts assessment, artifacts auto combination, artifacts statistics, artifacts potential, and more.

Home Page: https://www.mona-uranai.com/

License: MIT License

JavaScript 16.36% Python 0.01% HTML 0.22% Vue 17.59% CSS 0.03% Mustache 0.29% Rust 65.42% SCSS 0.07% Dockerfile 0.01%

genshin_artifact's Introduction

莫娜占卜铺

Netlify Status GitHub Repo stars GitHub forks

简介

  • 圣遗物自动搭配
  • 队伍圣遗物自动搭配
  • 响应式伤害计算器
  • 圣遗物潜力
  • 圣遗物养成推荐
  • more...

本地运行

该项目依赖Rust

  1. 安装Rust工具链,详见官网
  2. 安装Rust Webassembly工具链(wasm-pack)
  3. 安装node依赖
npm install
  1. 编译Rust依赖
cd mona
cargo run --bin gen_meta
wasm-pack build
  1. 本地运行
npm run serve

Docker

docker build -t mona .
docker run -dp 8080:80 mona

贡献

添加目标函数

目标函数在mona/src/target_functions/target_functions

  1. 在上述文件夹的对应位置建立新目标函数文件
  2. target_functions/target_function_name.rs新建目标函数名
  3. 创建一个struct,必须以TargetFunction结尾
pub struct NewTargetFunction {
    ...
}
  1. 如果该函数有设置,在target_functions/target_function_config.rs新建同名enum
  2. NewTargetFunction实现两个trait,TargetFunctionMetaTraitTargetFunction
impl TargetFunctionMetaTrait for NewTargetFunction {
    // 该目标函数的元数据
    #[cfg(not(target_family = "wasm"))]
    const META_DATA: TargetFunctionMeta = TargetFunctionMeta {
        name: TargetFunctionName::GanyuDefault,
        chs: "chs",
        description: "description",
        tags: "tag1,tag2",
        four: TargetFunctionFor::SomeWho(CharacterName::Ganyu),
        image: TargetFunctionMetaImage::Avatar
    };

    // 目标函数的设置,没有设置可以省略
    #[cfg(not(target_family = "wasm"))]
    const CONFIG: Option<&'static [ItemConfig]> = Some(&[
        ItemConfig {
            name: "melt_rate",
            title: "融化占比",
            config: ItemConfig::RATE01_TYPE
        }
    ]);

    fn create(character: &CharacterCommonData, weapon: &WeaponCommonData, config: &TargetFunctionConfig) -> Box<dyn TargetFunction> {
        // create boxed target function
    }
}

impl TargetFunction for NewTargetFunction {
    // 可以参考其他文件
}
  1. target_functions/target_functions/<element>/mod.rs中,重导出NewTargetFunction
// in <element>.rs
pub use new_target_function::NewTargetFunction;

genshin_artifact's People

Contributors

wormtql avatar jahooyoung avatar kkkkaizhu avatar dr-weial avatar kawayiyokami avatar yinxin630 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.