Project1

标题: RPGXP 数据结构等模块 能否重定义 [打印本页]

作者: 火星·奈    时间: 2014-2-21 15:29
标题: RPGXP 数据结构等模块 能否重定义
想重定义 RPG::Event  怎么做?
{:2_263:}
作者: myownroc    时间: 2014-2-21 16:19
试一下
  1. module RPG
  2.   class Event
  3.   end
  4. end
复制代码

作者: satgo1546    时间: 2014-2-21 16:55
  1. class RPG::Event # You *can*
  2.   def hello # define
  3.     puts "redefine" # a method
  4.   end # in a pre-
  5. end # defined class
复制代码
Ruby里任何类均可重定义。
作者: 火星·奈    时间: 2014-2-22 14:58
satgo1546 发表于 2014-2-21 16:55
Ruby里任何类均可重定义。




@myownroc  
作者: 晴兰    时间: 2014-2-22 17:47
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1