GithubHelp home page GithubHelp logo

Comments (4)

deklanw avatar deklanw commented on August 17, 2024 1

Well, I'm using sqlx. Turns out that postgres doesn't support unsigned integers, so it's more convenient for them to be signed. Also, I wanted to derive sqlx::Type to make everything more seamless.

Also, for my own purposes I wanted to assign a rank to every game; the median rank works well. But, for that I can't have gaps in the integer representation

from riven.

MingweiSamuel avatar MingweiSamuel commented on August 17, 2024

Yeah I tried a few different things to avoiding adding an UNRANKED tier but my main goals are to closely match Riot's API and avoid manual maintenance.

Personally I would keep (Tier, Division) both required and have an UNRANKED tier imply unranked regardless of division, and use (Tier::UNRANKED, Division::I).
There are a few other edge cases to consider with apex tiers, they are all technically Division::I so (Tier::CHALLENGER, Division::III) is invalid.
There are a few rank utilities in https://docs.rs/riven/1.4.0/riven/consts/ranks/index.html that could be expanded on to make dealing with ranks easier. Open to suggestions/PRs.

And the u8 values are completely arbitrary and follow semantic versioning (won't change). In the past I have used consecutive values from zero but then grandmaster threw a wrench in that so I spaced them out to future-proof that. Might have gone a bit overboard with the spacing though.

from riven.

deklanw avatar deklanw commented on August 17, 2024

I see. That all makes sense to me.

I realized I had other things to change with these enums so I just ended up copy-and-pasting your definitions and changing them for my code. Not totally sure if that's advisable in the end, but for now it's working.

Thanks

from riven.

MingweiSamuel avatar MingweiSamuel commented on August 17, 2024

Sure. Out of curiosity, what changes did you make?

from riven.

Related Issues (20)

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.