module CES

MAIN RUN METHOD

Systems are given the following arguments: component hash, eid integer

Constants

VERSION

Public Class Methods

loadcomponents(directory = "components") click to toggle source
# File lib/load.rb, line 2
def self.loadcomponents(directory = "components")
        filenames = []
        components = []
        current_file_data = nil
        current_parsed_data = nil
        
        filenames = Dir.entries(File.join(".", directory)).select { |f| !File.directory? f }
        #p filenames
        
        filenames.each { |current_file_name|
                current_file_data = File.read(File.join(".", directory, current_file_name))
                current_parsed_data = JSON.parse(current_file_data)
                components.push(current_parsed_data)
        }
        #p components
        
        # add components to component reference
        CES::ComponentReference.loadedcomponents(components)
        
        return components
end
loadsystems(directory = "systems") click to toggle source
# File lib/load.rb, line 23
def self.loadsystems(directory = "systems")
        systemfilenames = []
        
        systemfilenames = Dir.entries(File.join(".", directory)).select { |f| !File.directory? f }
        
        systemfilenames.each { |current_file_name|
                require File.join(".", directory, current_file_name)
        }
        
        return CES::SystemReference.systems
end
run_example() click to toggle source
# File lib/ces.rb, line 35
def self.run_example
        p CES.loadcomponents
        p CES.loadsystems.keys
        
        p CES::Entity.new("print_current_time_with_append")
        
        CES::SystemReference.run
end