Ejemplo n.º 1
0
    public void Set(Regulus.Project.ItIsNotAGame1.Data.Item item)
    {
        _Item = item;
        Name.text =  item.Count.ToString();

        Image.sprite = (Sprite)UnityEngine.Resources.Load("Icon/Item/" + _Item.Name , typeof(Sprite));
    }
Ejemplo n.º 2
0
 private static void _Initial(Regulus.Remoting.Soul.Native.Application application)
 {
     application.SelectSystemEvent += (selector) =>
     {
         _Spawn(selector.Use("stand"));
     };
 }
Ejemplo n.º 3
0
        private void _ToInGameState(Regulus.Remoting.ISoulBinder provider)
        {
            InGameState inGameState = new InGameState(provider);
            StageMachine.Push(inGameState);

            inGameState.OnBackLoginEvent += () => { _ToLoginState(provider); };
        }
Ejemplo n.º 4
0
 public StageRun(Regulus.Game.ICore core,Utility.Command command,int port , Utility.Console.IViewer viewer)
 {
     _View = viewer;
     this._Command = command;
     _ThreadSocketHandler = new ThreadSocketHandler(port, core);
     _ThreadSocket = new System.Threading.Thread(_ThreadSocketHandler.DoWork);
 }
Ejemplo n.º 5
0
 void Regulus.Remoting.PhotonExpansion.IPhotonFramework.ObtainController(Regulus.Remoting.Soul.SoulProvider provider)
 {
     var soul = new CTestSoul();
     provider.Bind<TestRemotingCommon.ITest>(soul);
     soul.invoke();
     //provider.Unbind<TestRemotingCommon.ITest>(soul);
 }
Ejemplo n.º 6
0
        public TcpController(Regulus.Utility.Command command, Regulus.Utility.Console.IViewer view)
        {
            _Command = command;
            _View = view;

            _Machine = new Game.StageMachine();
        }
Ejemplo n.º 7
0
        internal void Update(IObserveAbility observe, Regulus.Project.TurnBasedRPG.Map.EntityInfomation[] entitys, List<IObservedAbility> lefts)
        {
            foreach (var exit in lefts)
            {
                _Remove(_Within, exit.Id);
                if (LeftEvent != null)
                    LeftEvent(exit);

            }

            foreach(var e in entitys.Except(_Within))
            {
                if (e.Observed != null)
                {
                    if (IntoEvent != null)
                        IntoEvent(e.Observed);
                }

            }
            foreach (var e in _Within.Except(entitys))
            {
                if (e.Observed != null)
                {
                    if (LeftEvent != null)
                        LeftEvent(e.Observed);
                }

            }
            _Within = entitys.ToList();
        }
Ejemplo n.º 8
0
 public ConnectStage(Regulus.Remoting.Ghost.TProvider<Project.SamebestKeys.IConnect> connect_provider, OnConnect connect)
 {
     // TODO: Complete member initialization
     this._ConnectProvider = connect_provider;
     _Connect = connect;
     _Connecter = new Connect();
 }
Ejemplo n.º 9
0
 public BotConnectStage(Regulus.Project.SamebestKeys.IUser _User, string ip, int port)
 {
     // TODO: Complete member initialization
     this._User = _User;
     this.ip = ip;
     this.port = port;
 }
Ejemplo n.º 10
0
        //private void _ToConnectState(Regulus.Remoting.ISoulBinder provider)
        //{
        //ConnectStates connectState = new ConnectStates(provider);
        //StageMachine.Push(connectState);
        //connectState.OnDoneEvent += () => { _ToLoginState(provider); };
        //}
        private void _ToLoginState(Regulus.Remoting.ISoulBinder provider)
        {
            LoginStates loginState = new LoginStates(provider);
            StageMachine.Push(loginState);

            loginState.OnDoneEvent += () => { _ToInGameState(provider); };
        }
Ejemplo n.º 11
0
 public Regulus.Project.Crystal.Game.Core CreateUser(Regulus.Remoting.ISoulBinder binder, IStorage storage, IMap zone , Battle.IZone battle)
 {
     var core = new Regulus.Project.Crystal.Game.Core(binder, storage, zone, battle);
     _Users.AddFramework(core);
     core.InactiveEvent += () => { _Users.RemoveFramework(core); };
     return core;
 }
Ejemplo n.º 12
0
 public VerifyStage(string _Account, string _Password, Regulus.Remoting.INotifier<Regulus.Project.ItIsNotAGame1.Data.IVerify> providerNotice)
 {
     // TODO: Complete member initialization
     this._Account = _Account;
     this._Password = _Password;
     this._Provider = providerNotice;
 }
Ejemplo n.º 13
0
 private void _ToListen(Regulus.Remoting.Soul.Native.Server server)
 {
     var stage = new HostListenStage(server);
     stage.DoneEvent += _ToSetting;
     _DrawWindow = stage.DrawWindow;
     _Machine.Push(stage);
 }
Ejemplo n.º 14
0
    private Regulus.Project.TurnBasedRPG.Data.Entity _Build(Regulus.Project.TurnBasedRPG.Data.StaticEntity entity, GameObject game_object)
    {
        var bc = game_object.GetComponent<BoxCollider>();

        if (bc != null)
        {
            float x = game_object.transform.position.x;

            float y = game_object.transform.position.z;

            float w = game_object.transform.localScale.x * bc.size.x;

            float h = game_object.transform.localScale.z * bc.size.z;

            float r = game_object.transform.rotation.eulerAngles.y;

            Debug.Log("x" + x + " " + "y" + y + " " + "w" + w + " " + "h" + h + " " + "r" + r + " ");
            var obb = new Regulus.Utility.OBB(x, y, w, h);
            obb.setRotation(r);

            entity.Obb = obb;
            return _Build(entity as Regulus.Project.TurnBasedRPG.Data.Entity, game_object);
        }
        throw new System.Exception("BoxCollider is null " + game_object.name);
    }
Ejemplo n.º 15
0
 void _Observed_ShowActionEvent(Regulus.Project.SamebestKeys.Serializable.MoveInfomation obj)
 {
     if (obj.Speed == 0)
     {
         _Player.Walk(Regulus.Utility.Random.Next(0, 360),0);
     }
 }
Ejemplo n.º 16
0
 public User(Regulus.Remoting.Soul.SoulProvider provider , Regulus.Project.TurnBasedRPG.UserRoster user_roster , IWorld world)
 {
     _UserRoster = user_roster;
     _Machine = new Regulus.Game.StageMachine<User>(this);
     Provider = provider;
     provider.BreakEvent += Quit;
     _World = world;
 }
Ejemplo n.º 17
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();
 }
Ejemplo n.º 18
0
 void PlayerProvider_Supply(Regulus.Project.SamebestKeys.IPlayer obj)
 {
     _Player = obj;
     _Player.SetPosition(Regulus.Utility.Random.Next(0 , 30), Regulus.Utility.Random.Next(0, 30));
     _Player.SetSpeed(1);
     _Player.Walk(Regulus.Utility.Random.Next(0,360));
     _TimeCounter.Reset();
 }
Ejemplo n.º 19
0
        public void CreateUserInstance(Regulus.Remoting.ISoulBinder provider)
        {
            User user = new User(provider);

            _UserSet.Add(user);

            provider.BreakEvent += () => { _UserSet.Remove(user); };
        }
Ejemplo n.º 20
0
        private UserController _CreateUser(Regulus.Utility.Updater<Regulus.Utility.IUpdatable> frameworkRoot)
        {
            Console.WriteLine("建立使用者.");
            UserController user = new UserController();

            frameworkRoot.Add(user);
            return user;
        }
Ejemplo n.º 21
0
    private void InventoryNotifierProvider_Supply(Regulus.Project.ItIsNotAGame1.Data.IInventoryNotifier obj)
    {
        _ReleaseNotifier();
        _InventoryNotifier = obj;

        _InventoryNotifier.RemoveEvent += _RemoveItem;
        _InventoryNotifier.AddEvent += _AddEvent;
    }
Ejemplo n.º 22
0
        public Service(Regulus.Remoting.ISoulBinder binder, Storage storage , int account_id)
        {
            // TODO: Complete member initialization
            this._Binder = binder;
            this._Storage = storage;

            _Id = account_id;
        }
Ejemplo n.º 23
0
 void Regulus.Game.ICore.ObtainController(Regulus.Remoting.ISoulBinder binder)
 {
     binder.Bind<TestNativeGameCore.IMessager>(this);
     binder.BreakEvent += () =>
     {
         binder.Unbind<TestNativeGameCore.IMessager>(this);
     };
 }
Ejemplo n.º 24
0
    public void SetPosision(Regulus.CustomType.Vector2 position)
    {
        _Target = new Vector2(position.X , position.Y );

        /*var scaleX = _Rect.localScale.x;
        var scaleY = _Rect.localScale.y;
        _Rect.anchoredPosition = new Vector2(-position.X * scaleX + Viewport.rect.width / 2, -position.Y * scaleY + Viewport.rect.height / 2);*/
    }
Ejemplo n.º 25
0
        private static void _Export(Regulus.Utility.Console.IViewer view, Wheel wheel)
        {
            var data = wheel.Export();

            var guid = System.Guid.NewGuid();
            var path = $"Export{guid}.txt";
            view.WriteLine(path);
            System.IO.File.WriteAllText(path, Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
Ejemplo n.º 26
0
 public User(Remoting.ISoulBinder provider, Regulus.Project.SamebestKeys.UserRoster user_roster, IWorld world , IStorage storage)
 {
     _Storage = storage;
     _UserRoster = user_roster;
     _Machine = new Regulus.Game.StageMachine<User>(this);
     Provider = provider;
     provider.BreakEvent += Quit;
     _World = world;
 }
Ejemplo n.º 27
0
        public Map(string name,Regulus.Remoting.ITime time)
        {
            _Updater = new Utility.Updater();
            _Id = Guid.NewGuid();
            _Name = name;
            _SetTime(time);

            _Session = new Session.Session();
        }
Ejemplo n.º 28
0
 void _Connect_ConnectedEvent(string account, int password, Regulus.Remoting.Value<bool> result)
 {
     Regulus.Remoting.Value<bool> r = _Agent.Connect(account, password);
     r.OnValue += (success) =>
     {
         DoneEvent();
         result.SetValue(success);
     };
 }
Ejemplo n.º 29
0
 void _OnConnect(string ipaddr, int port, Regulus.Remoting.Value<bool> result)
 {
     var value = _Connect(ipaddr , port);
     value.OnValue += (ret) =>
     {
         result.SetValue(ret);
         ResultEvent(ret);
     };
 }
Ejemplo n.º 30
0
        public BatchCommander(Regulus.Utility.Command command)
        {
            _Timer = new Regulus.Utility.TimeCounter();

            this._Command = command;

            _Command.Register("1" , _1);
            _CommandStrings = new Queue<CommandString>();
        }