Exemplo n.º 1
0
    private void _ToMode(GameModeSelector <IUser> selector)
    {
        UserProvider <IUser> provider;

        if (Mode == MODE.REMOTING)
        {
            selector.AddFactoty("r", new RemotingUserFactory());
            provider = selector.CreateUserProvider("r");
        }
        else
        {
            this.Resource.Load();
            var feature = new Regulus.Project.ItIsNotAGame1.Game.DummyFrature();
            var center  = new Center(feature, feature);

            _Updater.Add(center);
            selector.AddFactoty("s", new StandaloneUserFactory(center));
            provider = selector.CreateUserProvider("s");
        }

        var user = provider.Spawn("user");

        provider.Select("user");

        User = user;
        User.Remoting.OnlineProvider.Supply   += _SupplyOnline;
        User.Remoting.OnlineProvider.Unsupply += _UnsupplyOnline;
        User.JumpMapProvider.Supply           += _JumpMap;
    }
Exemplo n.º 2
0
    private void _ToMode(GameModeSelector<IUser> selector)
    {
        UserProvider<IUser> provider;
        if (Mode == MODE.REMOTING)
        {
            selector.AddFactoty("r", new RemotingUserFactory());
            provider = selector.CreateUserProvider("r");
        }
        else
        {
            this.Resource.Load();
            var feature = new Regulus.Project.ItIsNotAGame1.Game.DummyFrature();
            var center = new Center(feature, feature);

            _Updater.Add(center);
            selector.AddFactoty("s", new StandaloneUserFactory(center));
            provider = selector.CreateUserProvider("s");
        }

        var user = provider.Spawn("user");
        provider.Select("user");

        User = user;
        User.Remoting.OnlineProvider.Supply += _SupplyOnline;
        User.Remoting.OnlineProvider.Unsupply += _UnsupplyOnline;
        User.JumpMapProvider.Supply += _JumpMap;
    }