コード例 #1
0
        static void Main(string[] args)
        {
            Regulus.Utility.Console.IViewer viwer = new Regulus.Utility.ConsoleViewer();
            var input = new Regulus.Utility.ConsoleInput(viwer);

            TestNativeUser.Application appliaction = new TestNativeUser.Application(viwer, input);

            var app = new Appliaction(appliaction, viwer);

            Regulus.Utility.Updater updater = new Regulus.Utility.Updater();
            appliaction.SetLogMessage(Regulus.Utility.Console.LogFilter.All);
            updater.Add(app);
            updater.Add(appliaction);

            bool exit = false;

            appliaction.Command.Register("quit", () => { exit = true; });

            while (exit == false)
            {
                input.Update();
                updater.Update();
            }
            appliaction.Command.Unregister("quit");
        }
コード例 #2
0
ファイル: Application.cs プロジェクト: jiowchern/Regulus
        internal void Run()
        {
            Console.WriteLine("用摸的RPG");
            Console.WriteLine("系統啟動...");
            Regulus.Utility.Singleton<Regulus.Utility.ConsoleLogger>.Instance.Launch("SamebestKeys");

            Regulus.Utility.Updater<Regulus.Utility.IUpdatable> frameworkRoot = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();

            bool userRunning = true;
            var user = _CreateUser(frameworkRoot);
            user.Quit += () =>
            {
                userRunning = false;
            };
            _CreateRandomBot(frameworkRoot);

            _CreateStageBot(frameworkRoot);

            while (userRunning)
            {
                frameworkRoot.Update();
            }
            frameworkRoot.Shutdown();
            Console.WriteLine("系統關閉...");
            Regulus.Utility.Singleton<Regulus.Utility.ConsoleLogger>.Instance.Shutdown();
            Console.WriteLine("關閉完成.");
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: kof1016/Regulus
        static void Main(string[] args)
        {
            Regulus.Utility.Console.IViewer viwer = new Regulus.Utility.ConsoleViewer();
            var input = new Regulus.Utility.ConsoleInput(viwer);
            var server = new Regulus.Remoting.Soul.Native.Application(viwer, input);

            Regulus.Utility.Updater<Regulus.Utility.IUpdatable> updater = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();
            updater.Add(server);

            bool exit = false;

            server.Command.Register("quit",
                () =>
                {
                    exit = true;
                });
            _Initial(server);

            while (exit == false)
            {
                updater.Update();
                input.Update();
            }

            server.Command.Unregister("quit");
            updater.Shutdown();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: jiowchern/Regulus
        static void Main(string[] args)
        {
            var view = new Regulus.Utility.ConsoleViewer();
            var input = new Regulus.Utility.ConsoleInput(view);

            var application = new Regulus.Project.SamebestKeys.Console(view, input);

            _BuildGameData(view);
            BotSet bots = new BotSet();

            application.SetLogMessage(Regulus.Utility.Console.LogFilter.All);

            Regulus.Utility.Updater updater = new Regulus.Utility.Updater();

            updater.Add(application);
            updater.Add(input);
            updater.Add(bots);

            bool exit = false;
            application.Command.Register("quit", () => { exit = true; });
            application.Command.Register<string,int>("SetBotIp",
                (ip,port) =>
                {
                    Bot.Port = port;
                    Bot.IpAddress = ip;
                });
            application.Command.Register<int>("BotSn", (sn) =>
            {
                bots.Sn = sn;
            });

            application.Command.Register<int>("Bot", (count) =>
            {
                bots.Create(count);
            });
            application.SelectSystemEvent += (selector) =>
            {
                var value = selector.Use("remoting");
                value.OnValue += _SpawnController;
                value.OnValue += (requester) =>
                {
                    bots.Requester = requester;
                };
            };

            Regulus.Utility.TimeCounter fps = new Regulus.Utility.TimeCounter(); ;
            while (exit == false)
            {
                updater.Update();
                fps.Reset();
            }
            application.Command.Unregister("SetBotIp");
            application.Command.Unregister("BotSn");
            application.Command.Unregister("Bot");
            application.Command.Unregister("quit");
            application.Stop();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: kof1016/Regulus
        static void Main(string[] args)
        {
            var view = new Regulus.Utility.ConsoleViewer();
            var input = new Regulus.Utility.ConsoleInput(view);

            var application = new Regulus.Project.SamebestKeys.Console(view, input);

            BotSet bots = new BotSet();

            application.SetLogMessage(Regulus.Utility.Console.LogFilter.All);

            Regulus.Utility.Updater<Regulus.Utility.IUpdatable> updater = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();

            updater.Add(application);
            updater.Add(input);
            updater.Add(bots);

            bool exit = false;
            application.Command.Register("quit", () => { exit = true; });
            application.Command.Register<int>("Bot", (count) =>
            {
                bots.Create(count);
            });
            application.SelectSystemEvent += (selector) =>
            {
                var value = selector.Use("remoting");
                value.OnValue += _SpawnController;
                value.OnValue += (requester) =>
                {
                    bots.Requester = requester;
                };
            };

            Regulus.Utility.TimeCounter fps = new Regulus.Utility.TimeCounter(); ;
            while (exit == false)
            {
                if (fps.Second > 1.0 / 60)
                {
                    updater.Update();
                    fps.Reset();
                }
            }
            application.Command.Unregister("Bot");
            application.Command.Unregister("quit");
            application.Stop();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            Regulus.Utility.Console.IViewer viwer = new Regulus.Utility.ConsoleViewer();
            var input  = new Regulus.Utility.ConsoleInput(viwer);
            var server = new Regulus.Remoting.Soul.Native.Application(viwer, input);

            Regulus.Utility.Updater <Regulus.Utility.IUpdatable> updater = new Regulus.Utility.Updater <Regulus.Utility.IUpdatable>();
            updater.Add(server);

            bool exit = false;

            server.Command.Register("quit", () => { exit = true; });

            while (exit == false)
            {
                updater.Update();
                input.Update();
            }

            server.Command.Unregister("quit");
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: jiowchern/Regulus
        static void Main(string[] args)
        {
            bool exit = false;
            Regulus.Utility.ConsoleViewer view = new Regulus.Utility.ConsoleViewer();
            Regulus.Utility.ConsoleInput input = new Regulus.Utility.ConsoleInput(view);

            Imdgame.RunLocusts.Client client = new Imdgame.RunLocusts.Client(view, input);

            Regulus.Utility.Updater updater = new Regulus.Utility.Updater();

            client.Command.Register("quit", () => { exit = true; });

            updater.Add(client);
            updater.Add(input);

            while (exit == false)
            {
                updater.Update();
            }

            updater.Shutdown();
        }
コード例 #8
0
        bool Regulus.Utility.IUpdatable.Update()
        {
            _Bots.Update();

            if (_BotAmount > 0)
            {
                _BotAmount--;
                var name      = "jc" + _BotSn.ToString();
                var userValue = _UserRequester.Spawn(name, false);
                userValue.OnValue += (user) =>
                {
                    var bot = _CreateBot(user, name);
                    bot.ExitEvent += () =>
                    {
                        _UserRequester.Unspawn(name);
                        _RestoryBot(bot.User);
                    };
                };
                _BotSn++;
            }
            return(true);
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: kof1016/RegulusTest
        static void Main(string[] args)
        {
            System.Reflection.Assembly.LoadFrom("GameCore.dll");
            var view = new Regulus.Utility.ConsoleViewer() as Regulus.Utility.Console.IViewer;
            var input = new Regulus.Utility.ConsoleInput(view);
            var application = new Terry.Project.User.ClientUserFramework(view, input);

            Regulus.Utility.Updater updater = new Regulus.Utility.Updater();
            updater.Add(application);
            updater.Add(input);

            bool exit = false;
            application.Command.Register("quit", () => { exit = true; });
            application.Command.Register("sp", () => { application.Command.Run("spawncontroller" , new string[]{"1"}); });
            application.Command.Register("sl", () => { application.Command.Run("selectcontroller", new string[] { "1" }); });

            while(exit == false)
            {
                updater.Update();
            }
            updater.Shutdown();
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: jiowchern/Regulus
        static void Main(string[] args)
        {
            Regulus.Utility.Console.IViewer viwer = new Regulus.Utility.ConsoleViewer();
            var input = new Regulus.Utility.ConsoleInput(viwer);
            TestNativeUser.Application appliaction = new TestNativeUser.Application(viwer, input);

            var app = new Appliaction(appliaction, viwer);

            Regulus.Utility.Updater updater = new Regulus.Utility.Updater();
            appliaction.SetLogMessage(Regulus.Utility.Console.LogFilter.All);
            updater.Add(app);
            updater.Add(appliaction);

            bool exit = false;
            appliaction.Command.Register("quit", () => { exit = true; });

            while (exit == false)
            {
                input.Update();
                updater.Update();

            }
            appliaction.Command.Unregister("quit");
        }
コード例 #11
0
ファイル: User.cs プロジェクト: tuita520/Regulus
 bool Regulus.Utility.IUpdatable.Update()
 {
     _Updater.Update();
     return(true);
 }