Exemplo n.º 1
0
 public Behavior(Entity entity)
 {
     _SelfUpdater = new Utility.Updater();
     _SelfUpdater.Add(this);
     _Entity = entity;
     _Machine = new Utility.StageMachine();
 }
Exemplo n.º 2
0
 public User()
 {
     _Updater         = new Regulus.Utility.Updater();
     _ConnectProvider = new Regulus.Remoting.Ghost.TProvider <TestNativeGameCore.IConnect>();
     _Connecter       = new Connect();
     _Complex         = new Regulus.Remoting.Ghost.Native.Agent();
 }
Exemplo n.º 3
0
        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("關閉完成.");
        }
Exemplo n.º 4
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");
        }
Exemplo n.º 5
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;
                });
            _Initial(server);

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

            server.Command.Unregister("quit");
            updater.Shutdown();
        }
Exemplo n.º 6
0
 public User()
 {
     _Updater = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();
     _ConnectProvider = new Regulus.Remoting.Ghost.TProvider<TestNativeGameCore.IConnect>();
     _Connecter = new Connect();
     _Complex = new Regulus.Remoting.Ghost.Native.Agent();
 }
Exemplo n.º 7
0
        public RemotingUser()
        {
            _Complex = new Regulus.Remoting.Ghost.Native.Agent();
            _Updater = new Regulus.Utility.Updater();

            _Connect = new ClientUser.Connect(_Complex);
        }
Exemplo n.º 8
0
 public User(Regulus.Remoting.IAgent agent)
 {
     _Agent = agent;
     _ConnectProvider = new Regulus.Remoting.Ghost.TProvider<Regulus.Utility.IConnect>();
     _OnlineProvider = new Regulus.Remoting.Ghost.TProvider<Regulus.Utility.IOnline>();
     _Machine = new Regulus.Utility.StageMachine();
     _Updater = new Regulus.Utility.Updater();
 }
Exemplo n.º 9
0
        public Console(IEnumerable <Type> watch_types, Regulus.Utility.Console.IViewer view, Regulus.Utility.Console.IInput input) : base(view, input)
        {
            _WatchTypes = watch_types.Union(new Type[0]).ToArray();

            _Users    = new List <User>();
            _Updater  = new Utility.Updater();
            _Register = new AgentCommandRegister(Command);
        }
Exemplo n.º 10
0
        public RemotingController(Regulus.Utility.Command command, Regulus.Utility.Console.IViewer view)
        {
            _View    = view;
            _User    = new User();
            _Updater = new Regulus.Utility.Updater();

            _Command = command;
        }
Exemplo n.º 11
0
 public Complex(IStorage stroage)
 {
     _Time = new LocalTime();
     _Hall = new Hall();
     _World = new World(LocalTime.Instance);
     _Updater = new Utility.Updater<Utility.IUpdatable>();
     _Storage = stroage;
 }
Exemplo n.º 12
0
        public Map(string name,Regulus.Remoting.ITime time)
        {
            _Updater = new Utility.Updater();
            _Id = Guid.NewGuid();
            _Name = name;
            _SetTime(time);

            _Session = new Session.Session();
        }
Exemplo n.º 13
0
        void Regulus.Framework.ILaunched.Launch()
        {
            _Frameworks = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();
            _Maps = new List<Map>();

            _AddMap(_BuildMap("Ferdinand"));

            _AddMap(_BuildMap("Chasel"));
        }
Exemplo n.º 14
0
 public Complex(IStorage stroage)
 {
     _Time = new LocalTime();
     _Hall = new Hall();
     _World = new World(LocalTime.Instance);
     _Updater = new Utility.Updater();
     _Storage = stroage;
     _TimeCounter = new Utility.TimeCounter();
 }
Exemplo n.º 15
0
        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();
        }
Exemplo n.º 16
0
        public Scene(Team team, Zone zone, Remoting.Time time , bool need_recovery)
        {
            _Team = team;
            _Id = Guid.NewGuid();
            this._Zone = zone;
            this._Time = time;

            _Updater = new Utility.Updater();
            _NeedRecover = need_recovery;
        }
Exemplo n.º 17
0
 public Service(IBinderProvider entry, IProtocol protocol)
 {
     _Users             = new System.Collections.Generic.List <User>();
     this._Entry        = entry;
     this._Protocol     = protocol;
     _Updater           = new Utility.Updater();
     _Updater.AddEvent += (user) => _Entry.AssignBinder(((User)user).Binder, ((User)user).State);
     _ThreadUpdater     = new ThreadUpdater(_Update);
     _ThreadUpdater.Start();
 }
Exemplo n.º 18
0
        public RealmStage(Regulus.Remoting.ISoulBinder binder, IScene realm, Regulus.Project.SamebestKeys.Serializable.DBEntityInfomation[] actors, Belongings belongings)
        {
            _Binder = binder;
            this._Scene = realm;

            _Players = (from actor in actors select new Player(actor)).ToArray();

            _Observeds = new List<IObservedAbility>();
            _Belongings = belongings;
            _Updater = new Utility.Updater();
        }
Exemplo n.º 19
0
        public Levels(MapPrototype map_prototype, Squad squad)
        {
            _Position = 0.0f;
            _Id = Guid.NewGuid();
            this._MapPrototype = map_prototype;
            _Stations = new Queue<Station>(_MapPrototype.Stations);
            _StageMachine = new Regulus.Utility.StageMachine();

            _Platoon = new Platoon(squad);
            _Platoon.EmptyEvent += () => { ReleaseEvent(); };

            _Platoons = new Utility.Updater(); ;
        }
Exemplo n.º 20
0
        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();
        }
Exemplo n.º 21
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");
        }
Exemplo n.º 22
0
        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();
        }
Exemplo n.º 23
0
        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();
        }
Exemplo n.º 24
0
            void Regulus.Game.IStage.Enter()
            {
                var team1 = new Team(TeamSide.Left,_Platoon);

                var enemys = (from enemy in _Prototype.Enemys select new Teammate(new ActorInfomation() { Exp = 0, Prototype = enemy })).ToArray();

                var platoonEnemy = new Platoon(new Squad(Contingent.FormationType.Auxiliary, enemys , new AIController()));
                var team2 = new Team(TeamSide.Right, platoonEnemy);
                _Combat.Initial(team1, team2);
                _Combat.WinnerEvent += (winner) =>
                {
                    if (winner == team1)
                        ResultEvent(Result.Victory);
                    else
                        ResultEvent(Result.Failure);
                };

                _Combat.DrawEvent += () =>
                {
                    ResultEvent(Result.Failure);
                };
                _Platoons = new Utility.Updater<Platoon>();
                _Platoons.Add(platoonEnemy);
            }
Exemplo n.º 25
0
 public BotSet()
 {
     _Users = new Regulus.Utility.Updater();
 }
Exemplo n.º 26
0
 public Appliaction(TestNativeUser.Application appliaction, Regulus.Utility.Console.IViewer view)
 {
     _Bots             = new Regulus.Utility.Updater();
     this._Appliaction = appliaction;
     _View             = view;
 }
Exemplo n.º 27
0
 public Appliaction(TestNativeUser.Application appliaction , Regulus.Utility.Console.IViewer view)
 {
     _Bots = new Regulus.Utility.Updater();
     this._Appliaction = appliaction;
     _View = view;
 }
Exemplo n.º 28
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");
        }
Exemplo n.º 29
0
 public Hall()
 {
     _Users = new Regulus.Utility.Updater();
 }
Exemplo n.º 30
0
 public Game(IStorage stroage)
 {
     _Zone = new Zone();
     _Storage = stroage;
     _Update = new Utility.Updater();
 }
Exemplo n.º 31
0
 public Complex()
 {
     _Stroage = null;
     _Updater = new Utility.Updater();
     _Hall = new Hall();
 }
Exemplo n.º 32
0
 public Hall()
 {
     _FrameworkRoot = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();
 }
Exemplo n.º 33
0
 public OnlineStage(Regulus.Standalong.Agent agent , Regulus.Remoting.Ghost.TProvider<Project.SamebestKeys.IOnline> provider , Regulus.Projects.SamebestKeys.Standalong.Game game)
 {
     _Game = game;
     _Updater = new Utility.Updater();
     _Agent = agent;
     _Id = Guid.NewGuid();
     _Provider = provider;
 }
Exemplo n.º 34
0
 public Zone(Map[] maps)
 {
     _Maps = maps;
     _Updater = new Utility.Updater();
 }
Exemplo n.º 35
0
 public Game()
 {
     _Stroage = new Stroage();
     _Complex = new Regulus.Project.SamebestKeys.Complex(_Stroage);
     _Updater = new Utility.Updater();
 }
Exemplo n.º 36
0
 public ComplexServer()
 {
     _Storage = new Storage();
     _Complex = new Complex(_Storage);
     _Updater = new Utility.Updater();
 }
Exemplo n.º 37
0
 public ActorPropertyAbility(Serializable.EntityPropertyInfomation property , Serializable.EntityLookInfomation look)
 {
     _Property = property;
     _Look = look;
     _Mode = ActorMode.Explore;
     _Updater = new Utility.Updater();
     _ExpendEnergy = false;
 }