Class: RGSS::Game_SelfSwitches

Inherits:
Object
  • Object
show all
Includes:
BasicCoder
Defined in:
lib/RGSS.rb

Constant Summary

Constants included from BasicCoder

BasicCoder::INCLUDED_CLASSES

Instance Method Summary collapse

Methods included from BasicCoder

#encode_with, included, #init_with, #ivars, set_ivars_methods

Instance Method Details

#decode(name, value) ⇒ Object



384
385
386
387
388
389
390
391
392
393
# File 'lib/RGSS.rb', line 384

def decode(name, value)
    return(
        Hash[
            value.collect do |pair|
                key, value = pair
                next [key.scanf('%d %d %s'), value]
            end
        ]
    )
end

#encode(name, value) ⇒ Object



373
374
375
376
377
378
379
380
381
382
# File 'lib/RGSS.rb', line 373

def encode(name, value)
    return(
        Hash[
            value.collect do |pair|
                key, value = pair
                next ['%03d %03d %s' % key, value]
            end
        ]
    )
end