赞 | 274 |
VIP | 0 |
好人卡 | 3 |
积分 | 495 |
经验 | 40966 |
最后登录 | 2024-6-21 |
在线时间 | 1919 小时 |
Lv5.捕梦者
- 梦石
- 10
- 星屑
- 39540
- 在线时间
- 1919 小时
- 注册时间
- 2010-11-14
- 帖子
- 3319

|
那串16进制数是RPG::Actor对象的object_id
ruby文档的解释是这样的
object_id → fixnum
Returns an integer identifier for obj. The same number will be returned on all calls to id for a given object, and no two active objects will share an id.
Object#object_id is a different concept from the :name notation, which returns the symbol id of name. Replaces the deprecated Object#id.
简单来说,就是辨认对象唯一性的一串数字。
每个对象的object_id都不同,因此只要比较object_id就能知道是不是同一对象。
另外,在ruby里equal?方法做的就是比较两个对象的object_id。 |
评分
-
查看全部评分
|