module Plugin

Public Class Methods

install(id) click to toggle source
# File lib/GameGrid.rb, line 802
def self.install(id)
    puts "Tracking plugin ID..."
    id=id.to_s
    raker=$plgvaldb[id]
    $loadedplugin=raker.to_s
    puts "Your plugin, #{id} has been loaded. To run this plugin, you can either type $sector=-1; play if you have completed the tutorial, or you can type Plugin.run() to run the plugin, even if the tutorial was not done. Thank you."
end
load(hasher) click to toggle source
# File lib/GameGrid.rb, line 791
def self.load(hasher)
    error("Argument must be a hash, formulated by Plugin.load(code,name) function",ArgumentError) if hasher.class!=Hash;
    eval(hasher.values[0])
end
loadAll(*pk) click to toggle source
# File lib/GameGrid.rb, line 795
def self.loadAll(*pk)
    loadnum=0
    while (loadnum<pk.length)
        self.load(pk[loadnum])
        loadnum+=1;
    end
end
new(rubycode, name="Plugin.new") click to toggle source
# File lib/GameGrid.rb, line 785
def self.new(rubycode, name="Plugin.new")
    $plgvaldb[name.to_s]=rubycode.to_s
    hasher={name.to_s=>rubycode.to_s}
    puts "To install only locally, use Plugin.install(#{name}).\n To push to GameGrid servers, so the public can install your plugin, send an email with your Plugin name and Plugin code to tt2d [at] icloud [dot] com. \nTo see the output of your plugin, use self.load with an argument equal to this hash: \n"
    return hasher
end
run() click to toggle source
# File lib/GameGrid.rb, line 809
def self.run()
    raise "No plugin loaded yet", LoadError if ($loadedplugin=='');
    eval($loadedplugin);
end