Beispiel #1
0
        private static void Main(string[] args)
        {
            var bot = new BotBitsClient();

            // Events
            EventLoader
            .Of(bot)
            .LoadStatic <Program>();

            // Commands
            CommandsExtension.LoadInto(bot, '!', '.');
            CommandLoader
            .Of(bot)
            .LoadStatic <Program>();

            // Login
            Login.Of(bot)
            .AsGuest()
            .CreateJoinRoom("PW01");

            // Console commands
            while (true)
            {
                CommandManager.Of(bot).ReadNextConsoleCommand();
            }
        }
        public ScannerWindow(BotBitsClient client)
        {
            InitializeComponent();

            this.client = client;
            EventLoader.Of(client).Load(this);
        }
Beispiel #3
0
        private static void Main()
        {
            EventLoader.Of(bot).LoadStatic <Program>();

            Login.Of(bot).AsGuest().CreateJoinRoom("PW01");
            Thread.Sleep(Timeout.Infinite);
        }
Beispiel #4
0
        /// <summary>
        ///     Sets the BotBits client.
        /// </summary>
        /// <param name="c">The client.</param>
        public static void BindClient(BotBitsClient c)
        {
            if (client != null)
            {
                return;
            }

            client = c;
            EventLoader.Of(c).LoadStatic <ConsoleAwesome>();
        }
Beispiel #5
0
        private static void Main()
        {
            EventLoader
            .Of(bot)
            .LoadStatic <Program>();

            ConnectionManager
            .Of(bot)
            .GuestLogin()
            .CreateJoinRoom("PW01");

            Thread.Sleep(Timeout.Infinite);
        }
Beispiel #6
0
        public void EventLoadTest()
        {
            var botBits = new BotBitsClient();

            EventLoader
            .Of(botBits)
            .Load(this);

            Assert.IsTrue(
                TestEvent
                .Of(botBits)
                .Contains(this.OnTest));
        }
Beispiel #7
0
        public void EventLoadStaticTest()
        {
            var botBits = new BotBitsClient();

            EventLoader
            .Of(botBits)
            .LoadStatic <EventLoaderTests>();

            Assert.IsTrue(
                TestEvent
                .Of(botBits)
                .Contains(OnStaticTest));
        }
Beispiel #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var client = new BotBitsClient();

            EventLoader.Of(client).Load(this);

            loginWindow = new LoginWindow(client);
            loginWindow.Show();

            scannerWindow = new ScannerWindow(client);
        }
Beispiel #9
0
        public BlocksAreaDictionary(IBlockAreaEnumerable blockArea, BotBitsClient client, IBlockFilter filter)
        {
            this._client    = client;
            this._blockArea = blockArea;

            var fgGen = new ForegroundDictionaryLayerGenerator <BlocksItem>((p, b) => this._blockArea.At(p.X, p.Y));
            var bgGen = new BackgroundDictionaryLayerGenerator <BlocksItem>((p, b) => this._blockArea.At(p.X, p.Y));

            this.InternalForeground = new DictionaryBlockLayer <Foreground.Id, ForegroundBlock, BlocksItem, PointSet>(fgGen, filter);
            this.InternalBackground = new DictionaryBlockLayer <Background.Id, BackgroundBlock, BlocksItem, PointSet>(bgGen, filter);

            this.Reindex();

            EventLoader.Of(this._client).Load(this);
        }
Beispiel #10
0
        private static void Main(string[] args)
        {
            var bot = new BotBitsClient();

            // Dictionary
            BlocksDictionaryExtension.LoadInto(bot);

            // Events
            EventLoader
            .Of(bot)
            .LoadStatic <Program>();

            // Login
            Login.Of(bot)
            .AsGuest()
            .CreateJoinRoom("PW01");

            Console.WriteLine($"This world contains {BlocksDictionary.Of(bot)[Foreground.Coin.GoldDoor].Count} gold coin doors.");
        }
Beispiel #11
0
        public Scanner()
        {
            using (var r = new StreamReader("Login.txt"))
            {
                var email      = r.ReadLine().Trim();
                var password   = r.ReadLine().Trim();
                var worldId    = r.ReadLine().Trim();
                var dimensions = r.ReadLine().Trim().Split('x');
                var width      = int.Parse(dimensions[0]);
                var height     = int.Parse(dimensions[1]);

                EventLoader.Of(bot).Load(this);
                MapManagerExtension.LoadInto(bot, width, height);

                Login.Of(bot)
                .WithEmail(email, password)
                .CreateJoinRoom(worldId);
            }
        }
Beispiel #12
0
 private void EventListenerPackage_InitializeFinish(object sender, System.EventArgs e)
 {
     EventLoader
     .Of(this.BotBits)
     .Load(this);
 }
Beispiel #13
0
 public void Dispose()
 {
     EventLoader.Of(this._client).Unload(this);
 }