Beispiel #1
0
        protected TestOptions? TestData; //this is very important to have too.

        /// <summary>
        /// Called by the bootstrapper's constructor at runtime to start the framework.
        /// </summary>
        protected async Task StartRuntimeAsync()
        {
            if (_mode == EnumGamePackageMode.None)
            {
                MessageBox.Show("The mode must be debug or production.  Therefore, closing out");
                CloseApp();
                return;
            }
            Application = Application.Current;
            StartUp();
            OS = EnumOS.WindowsDT;
            SetPersonalSettings(); //i think
            PrepareApplication();
            OurContainer = new GamePackageDIContainer();
            cons = OurContainer;
            ShowCurrentUser();
            FirstRegister();
            await ConfigureAsync();
            if (_mode == EnumGamePackageMode.Debug)
            {
                await RegisterTestsAsync();
            }
            if (UseMultiplayerProcesses)
            {
                ///MessageBox.Show("Needs to figure out the multiplayer processes");
                //UIPlatform.ExitApp();
                //return;
                OurContainer.RegisterType<BasicMessageProcessing>(true);
                IRegisterNetworks tempnets = OurContainer.Resolve<IRegisterNetworks>();
                tempnets.RegisterMultiplayerClasses(OurContainer);
            }
            LinkViewModelViewAssemblies();
            await DisplayRootViewForAsync(); //has to do here now.
        }
        public void LoadList(PlayerBoardObservable <TR> thisMod)
        {
            _thisMod  = thisMod;
            _cardList = thisMod.CardList;
            _cardList.CollectionChanged += CardList_CollectionChanged;
            if (thisMod.Game == PlayerBoardObservable <TR> .EnumGameList.None)
            {
                throw new BasicBlankException("Must choose Skuck or Horseshoes");
            }
            if (_cardList.Count == 0)
            {
                throw new BasicBlankException("Must have cardlist already");
            }
            _thisGrid = new Grid();
            GamePackageDIContainer thisC     = Resolve <GamePackageDIContainer>();
            IProportionImage       thisImage = thisC.Resolve <IProportionImage>(ts.TagUsed);
            SKSize thisSize = _cardList.First().DefaultSize;
            SKSize usedSize = thisSize.GetSizeUsed(thisImage.Proportion);
            var    pixels   = usedSize.Height / 2;
            int    x;
            var    loopTo = _cardList.Count;

            for (x = 1; x <= loopTo; x++)
            {
                GridHelper.AddPixelRow(_thisGrid, (int)pixels);
            }
            GridHelper.AddPixelRow(_thisGrid, (int)pixels);
            pixels = usedSize.Width + 6;
            for (x = 1; x <= 4; x++)
            {
                GridHelper.AddPixelColumn(_thisGrid, (int)pixels);
            }
            PopulateControls();
            Content = _thisGrid;
        }
Beispiel #3
0
        //decided to do the mobile server somewhere else.  so if navigating to another game, no problem.  means the loader has to do it.

        //private BasicGameServerTCP? _tcpServer;
        void IRegisterNetworks.RegisterMultiplayerClasses(GamePackageDIContainer container)
        {
            //will figure out what needs to be registered for network classes.
            if (_global.ServerMode == EnumServerMode.MobileServer)
            {
                //everything required for mobile server.  this means you will listen on a port.  does mean you have to be closed out of the old or runtime errors.
                //_tcpServer = new BasicGameServerTCP();
                //decided to use port 8010 for this time.  hopefully will be okay.
                //_tcpServer.StartServer();
                container.RegisterType <ServerTCPClass>();
                container.RegisterType <TCPDirectSpecificIP>();
                return;
            }
            if (_global.ServerMode == EnumServerMode.LocalHosting)
            {
                container.RegisterType <ClientTCPClass>();
                container.RegisterType <TCPDirectSpecificIP>();
                return;
            }
            container.RegisterType <SignalRMessageService>();

            if (_global.ServerMode == EnumServerMode.AzureHosting)
            {
                container.RegisterType <SignalRAzureEndPoint>();
                return;
            }
            if (_global.ServerMode == EnumServerMode.HomeHosting)
            {
                container.RegisterType <SignalRLocalEndPoint>();
                return;
            }
            throw new BasicBlankException("No hosting found.  Rethinking required");
        }
        protected TestOptions?TestData;  //this is very important to have too.

        /// <summary>
        /// Called by the bootstrapper's constructor at runtime to start the framework.
        /// </summary>
        protected async Task StartRuntimeAsync()
        {
            if (_mode == EnumGamePackageMode.None)
            {
                //no messageboxes are allowed.
                return;
            }
            Application = Application.Current;
            StartUp();
            OurContainer = new GamePackageDIContainer();
            CustomPlatform.SetUp(OurContainer);
            //IScreen screen = OurContainer.Resolve<IScreen>();
            IGamePackageScreen screen = OurContainer.Resolve <IGamePackageScreen>();

            screen.CalculateScreens(); //try here.
            cons = OurContainer;
            FirstRegister();
            await ConfigureAsync();

            if (_mode == EnumGamePackageMode.Debug)
            {
                await RegisterTestsAsync();
            }
            if (UseMultiplayerProcesses)
            {
                ///MessageBox.Show("Needs to figure out the multiplayer processes");
                //UIPlatform.ExitApp();
                //return;
                OurContainer.RegisterType <BasicMessageProcessing>(true);
                IRegisterNetworks tempnets = OurContainer.Resolve <IRegisterNetworks>();
                tempnets.RegisterMultiplayerClasses(OurContainer);
            }
            LinkViewModelViewAssemblies();
            await DisplayRootViewForAsync(); //has to do here now.
        }
 void IStartUp.RegisterCustomClasses(GamePackageDIContainer container, bool multiplayer, BasicData data)
 {
     if (multiplayer == true)
     {
         throw new BasicBlankException("This can only be registered on single player classes");
     }
     //i think the only thing that needs to be registered is the autoresume classes alone.
     container.RegisterType <SinglePlayerProductionSave>();
 }
 void IStartUp.RegisterCustomClasses(GamePackageDIContainer container, bool multiplayer, BasicData data)
 {
     if (multiplayer == false)
     {
         throw new BasicBlankException("Only multiplayer are supported.  For single player, try different startup class that does not rely on signal r");
     }
     container.RegisterType <NetworkStartUp>();
     if (_global == null)
     {
         _global = GlobalDataLoaderClass.Open(data.IsXamarinForms);
     }
     container.RegisterSingleton(_global);
     container.RegisterType <MultiplayerProductionSave>();
 }
        public void Init(TriangleObservable thisMod)
        {
            SolitaireCard          card = new SolitaireCard();
            GamePackageDIContainer tt   = Resolve <GamePackageDIContainer>();
            IProportionImage       pp   = tt.Resolve <IProportionImage>(ts.TagUsed);

            _size     = card.DefaultSize.GetSizeUsed(pp.Proportion);
            _thisMod  = thisMod;
            _cardList = thisMod.CardList;
            _cardList.CollectionChanged += CollectionChange;
            _thisCanvas         = new AbsoluteLayout();
            _thisMod.PositionUI = this;
            PopulateCards();
            Content = _thisCanvas;
        }
Beispiel #8
0
        public void LoadControls(ClockObservable thisMod)
        {
            _thisMod           = thisMod;
            _thisCanvas        = new AbsoluteLayout();
            thisMod.PositionUI = this;
            Content            = _thisCanvas;
            SolitaireCard          card = new SolitaireCard();
            GamePackageDIContainer tt   = Resolve <GamePackageDIContainer>();
            IProportionImage       pp   = tt.Resolve <IProportionImage>(ts.TagUsed);

            _size = card.DefaultSize.GetSizeUsed(pp.Proportion);
            if (_thisMod.ClockList != null && _thisMod.ClockList.Count > 0)
            {
                PrivateReposition();
            }
        }
 void IGamePlatform.SetUp(GamePackageDIContainer container)
 {
     container.RegisterType <CustomScreenProcesses>();
     container.RegisterType <StandardButtonFontClass>();
     container.RegisterSingleton(this);
 }
Beispiel #10
0
 void IGamePlatform.SetUp(GamePackageDIContainer container)
 {
 }