Comments (4)
当前版本是按照Redis,根据一个浮点型的值作为判断分值。
可以将多个条件组合成一个分值, 例如
// 假设等级范围是[0,100), 境界范围是[0,10),
// 不考虑溢出
score = 战力 * 1000 + 等级 * 10 + 境界
可以将比较的分值改为接口,这样比较起来灵活。但是无法根据分值查找
from zset.
恩,我改借口。游戏,一般没有按分值查询的需求
from zset.
@XanthusL
考虑是用接口,还是像官方sort那样传入一个排序方法方便?
好像结果不对,问题出在哪里了?
from zset.
需要把所有比较score
的地方都换掉。
from zset.
Related Issues (12)
- 请问, zset 有在线上用吗? HOT 3
- 这个不是线程(协程)安全的,是否考虑在dict和zsl 加个锁? HOT 1
- 是否支持 zrange by score? HOT 1
- 能否改成支持泛型呢? HOT 2
- 为什么引入找不到cmp HOT 2
- 为什么不把节点objID存数据呢,而是多一个int HOT 1
- 可以处理下并列名次吗? HOT 3
- 你好,可否增加increaseby功能 HOT 11
- key是否能够支持string HOT 3
- ZRANGE support HOT 1
- score使用float64精度问题 HOT 8
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 zset.