Comments (4)
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.
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.
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.
Sure. Out of curiosity, what changes did you make?
from riven.
Related Issues (20)
- [TFT] UnitDto occasionally has extra field 'chosen' HOT 1
- [Help/Clarification] Rate limiting and actix state HOT 1
- Needs regen for new champion Rell HOT 1
- Support for new tft-league endpoint /tft/league/v1/rated-ladders/{queue}/top HOT 2
- tft-league result doesn't deserialize when the player has a hyperroll rank. HOT 3
- New gamemode HOT 4
- Include numeric enum values in docs HOT 1
- Handle `x-rate-limit-type: service` HOT 2
- add #[derive(Clone)] on models HOT 2
- Add EnumVariantNames derive to relevant enums
- How to serialize PlatformRoute, Tier, Division, etc? HOT 2
- Better `QueueType` enum handling
- u16 seems insufficient to represent champion id HOT 2
- Exponential back-off on 429s and 5xxs
- Re-enable val_content_ranked_test in tests_val_latam.rs HOT 1
- How do I handle users inputting invalid summoner names? HOT 1
- Nilah is missing from the champion pull
- OC1 -> SEA routing change HOT 1
- Error getting TFT games HOT 4
- Is there a way for me to see my current rate limit? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riven.