/// <summary> /// Register a drawable area with the singleton /// </summary> /// <param name="screen">The drawable area to register</param> public static void addScreen(DrawableScreen screen) { int timeout = 300; rwlock.AcquireWriterLock(timeout); try { foreach (DrawableScreen s in screens) { if (s.Equals(screen)) return; } screens.Add(screen); } finally { rwlock.ReleaseWriterLock(); } }
/// <summary> /// Internal use, the Bot will initialize the script with its input handlers once its loaded into memory /// </summary> /// <param name="bot">The reference to the bot's windowhandler</param> public void initializeInputs(WindowHandler bot) { this.EMouse = bot.MOUSE; this.EPreciseMouse = bot.PMOUSE; this.EMenuHandler = bot.MENU; this.ECommunicator = bot.COMMUNICATOR; this.EOverViewHandler = bot.OVERVIEW; this.EStationHandler = bot.STATION; this.MyShip = bot.SHIP; this.ESession = bot.SESSION; this.ECamera = bot.CAMERA; this.EKeyboard = bot.KEYBOARD; this.ELocalHandler = bot.LOCAL; this.EDrawingArea = bot.DrawingArea; this.ELogger = bot.LOGGER; this.ELogger.ScriptName = name; this.EAgentHandler = bot.AGENT; ERandom = new Random(); }