plugins/ruby/ruby-autogen-defs.rb
# allocate a new c++ object, return its ruby wrapper
allocate a new c++ object, return its ruby wrapper
allocate a new c ++ object return its ruby wrapper
def cpp_new(init=nil)
                    ptr = DFHack.malloc(_sizeof)
                    if _rtti_classname and vt = DFHack.rtti_getvtable(_rtti_classname)
                        DFHack.memory_write_ptr(ptr, vt)
                    end
                    o = new._at(ptr)
                    o._cpp_init
                    o._set(init) if init
                    o
                end
def cpp_new ( init = nil ) ptr = DFHack . malloc ( _sizeof ) if _rtti_classname and vt = DFHack . rtti_getvtable ( _rtti_classname ) DFHack . memory_write_ptr ( ptr , vt ) end o = new . _at ( ptr ) o . _cpp_init o . _set ( init ) if init o end
allocate a new c++ object, return its ruby wrapper
allocate a new c ++ object return its ruby wrapper
# TODO call constructor
init
<not_specific>