/*
 * Main Loop
 *
 */

// prototypes
require('prototype.prototype');

// global methods
global.C            = require('constants');
global.cli          = require('util.cli');
global.utils        = new (require('util.utils'));
global.logger       = new (require('util.logger'));

var Kernel          = require('kernel');
var Logger = require('util.logger');

var logger = new Logger('[Main]');
logger.level = C.LOGLEVEL.DEBUG;

module.exports.loop = function () {
    var kernel = new Kernel;

    kernel.run();
}

@@ -281,234 +281,1410 @@
 var 
-Kernel          = require('kernel');%0Avar Logger = require('util.logger');%0A%0Avar logger = new Logger('%5BMain%5D');%0Alogger.level = C.LOGLEVEL.DEBUG;%0A%0Amodule.exports.loop = function () %7B%0A    var kernel = new Kernel;%0A%0A    kernel.run();
+Director        = require('director.director');%0Avar Queue           = require('queue.queue');%0Avar Manage          = require('manage.manage');%0Avar Role            = require('role.role');%0Avar Task            = require('task.task');%0Avar Work            = require('work.work');%0Avar Mil             = require('mil.mil');%0Avar Visuals         = require('util.visuals');%0A%0Avar Logger = require('util.logger');%0A%0Avar logger = new Logger('%5BMain%5D');%0Alogger.level = C.LOGLEVEL.DEBUG;%0A%0Amodule.exports.loop = function () %7B%0A    let cpuStart = Game.cpu.getUsed();%0A%0A    Game.Director       = new Director;%0A    Game.Queue          = new Queue;%0A    Game.Role           = new Role;%0A    Game.Task           = new Task;%0A    Game.Work           = new Work;%0A    Game.Manage         = new Manage;%0A    Game.Mil            = new Mil;%0A    Game.Visuals        = new Visuals;%0A%0A    Game.Visuals.addLog(undefined, %7B%0A        command: 'init',%0A        status: 'OK',%0A        cpu: Game.cpu.getUsed(),%0A        output: 'memory usage: ' + (JSON.stringify(RawMemory).length / 1024).toFixed(2) + ' KB',%0A    %7D);%0A%0A%0A    Game.Visuals.addLog(undefined, %7B%0A        command: 'starting main',%0A    %7D);%0A%0A    Game.Queue.run();%0A    Game.Manage.run();%0A    Game.Director.run();%0A    Game.Mil.run();%0A%0A    Game.Visuals.addLog(undefined, %7B%0A        command: 'main',%0A        status: 'OK',%0A        cpu: (Game.cpu.getUsed() - cpuStart),%0A    %7D);%0A%0A    Game.Visuals.run();%0A
 %0A%7D%0A

revert main