當前位置: 首頁>>代碼示例>>C#>>正文


C# GamerServices.SignedInGamer類代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.GamerServices.SignedInGamer的典型用法代碼示例。如果您正苦於以下問題:C# SignedInGamer類的具體用法?C# SignedInGamer怎麽用?C# SignedInGamer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SignedInGamer類屬於Microsoft.Xna.Framework.GamerServices命名空間,在下文中一共展示了SignedInGamer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MainMenuScreen

        public MainMenuScreen(SignedInGamer gamerOne)
        {
            this.gamerOne = gamerOne;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);
        }
開發者ID:Harmonickey,項目名稱:AlexCSPortfolio,代碼行數:7,代碼來源:MainMenuScreen.cs

示例2: LiveIdentifiedPlayer

 /// <summary>
 /// Creates a new instance
 /// </summary>
 /// <param name="signedInGamer">The Xbox Live player SignedInGamer instance</param>
 internal LiveIdentifiedPlayer(SignedInGamer signedInGamer)
     : base(Application.Input.GetPlayerInput(signedInGamer.PlayerIndex))
 {
     LiveGamer = signedInGamer;
     UniqueId = signedInGamer.Gamertag;
     DisplayName = signedInGamer.Gamertag;
 }
開發者ID:rc183,項目名稱:igf,代碼行數:11,代碼來源:LiveIdentifiedPlayer.cs

示例3: HandleInput

        public override void HandleInput(InputState input)
        {
            if (!gamerSelected)
            {
                for (int i = 0; i < InputState.MaxInputs; i++)
                {
                    if (input.CurrentGamePadStates[i].IsButtonDown(Buttons.Start) == true && input.PreviousGamePadStates[i].IsButtonUp(Buttons.Start) == true ||
                        input.CurrentKeyboardStates[i].IsKeyDown(Keys.Enter) == true && input.PreviousKeyboardStates[i].IsKeyUp(Keys.Enter) ||
                        input.CurrentKeyboardStates[i].IsKeyDown(Keys.Space) == true && input.PreviousKeyboardStates[i].IsKeyUp(Keys.Space))
                    {
                        gamerOne = Gamer.SignedInGamers[(PlayerIndex)i];

                        gamerSelected = true;

                        if (gamerOne == null)
                        {
                            if (!Guide.IsVisible)
                            {
                                Guide.ShowSignIn(1, false);
                            }
                        }
                    }
                }
            }
        }
開發者ID:Harmonickey,項目名稱:AlexCSPortfolio,代碼行數:25,代碼來源:StartScreen.cs

示例4: NetworkGameMenu

        public NetworkGameMenu(PlayerIndex enteringPlayer)
            : base("Start a network game")
        {
            currentPlayerIndex = enteringPlayer;
            currentGamer = SignedInGamer.SignedInGamers[currentPlayerIndex];
            // Create our menu entries.
            if (currentGamer != null)
            {
                opt1 = new MenuEntry("Currently signed in");
            }
            else
            {
                opt1 = new MenuEntry("Select to sign in");
                SignedInGamer.SignedIn += new EventHandler<SignedInEventArgs>(gamerSignIn);
            }
            MenuEntry opt2 = new MenuEntry("Host local network game");
            MenuEntry opt3 = new MenuEntry("Join local newtwork game");
            MenuEntry opt4 = new MenuEntry("Go Back");

            opt1.Selected += LiveSignIn;
            opt2.Selected += HostLocalGame;
            opt3.Selected += FindLocalGame;
            opt4.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(opt1);
            MenuEntries.Add(opt2);
            MenuEntries.Add(opt3);
            MenuEntries.Add(opt4);
            SetMenuEntryText();
        }
開發者ID:nchoumitsky,項目名稱:Meatieroids,代碼行數:31,代碼來源:NetworkGameMenu.cs

示例5: LocalNetworkGameMenu

        public LocalNetworkGameMenu(PlayerIndex enteringPlayer, NetworkSession nSession)
            : base("Local Network Game Lobby")
        {
            netSession = nSession;
            currentPlayerIndex = enteringPlayer;
            currentGamer = SignedInGamer.SignedInGamers[currentPlayerIndex];
            netSession.GameStarted += new EventHandler<GameStartedEventArgs>(loadNetworkGameScreen);

            // Create our menu entries.
            gameTypeOption = new MenuEntry("Game Type: " + GameType());
            highScoreOption = new MenuEntry("Score to Win: " + WinningScore());
            opt2 = new MenuEntry("Host: " + nSession.Host.ToString());
            opt3 = new MenuEntry("Ready?");
            opt4 = new MenuEntry("Waiting for opponent");
            opt5 = new MenuEntry("Go Back");

            netSession.GameStarted += new EventHandler<GameStartedEventArgs>(StartGame);

            gameTypeOption.Selected += changeGameType;
            highScoreOption.Selected += changeWinningScore;
            opt3.Selected += setReady;
            opt4.Selected += startGame;
            opt5.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(gameTypeOption);
            MenuEntries.Add(highScoreOption);
            MenuEntries.Add(opt2);
            MenuEntries.Add(opt3);
            MenuEntries.Add(opt4);
            MenuEntries.Add(opt5);

            SetMenuEntryText();
        }
開發者ID:nchoumitsky,項目名稱:Meatieroids,代碼行數:34,代碼來源:LocalNetworkGameMenu.cs

示例6: SignedInEventArgs

 public SignedInEventArgs(SignedInGamer gamer)
 {
     if (gamer == null)
     {
         throw new ArgumentNullException("gamer");
     }
     this.gamer = gamer;
 }
開發者ID:kiichi7,項目名稱:monoxna,代碼行數:8,代碼來源:SignedInEventArgs.cs

示例7: CharacterSelectScreen

        public CharacterSelectScreen(SignedInGamer gamerOne)
            : base("Character Select")
        {
            this.gamerOne = gamerOne;

            TransitionOnTime = TimeSpan.FromSeconds(0.3);
            TransitionOffTime = TimeSpan.FromSeconds(0.3);
        }
開發者ID:Harmonickey,項目名稱:AlexCSPortfolio,代碼行數:8,代碼來源:CharacterSelectScreen.cs

示例8: LocalGamer

        internal LocalGamer(SignedInGamer gamer)
        {
            SignedInGamer = gamer;
            SignedInGamer.Tag = this;

            reader = new PacketReader();
            Writer = new PacketWriter();

            InitializeSystemPackets();
        }
開發者ID:BeauPrime,項目名稱:Networking,代碼行數:10,代碼來源:LocalGamer.cs

示例9: LoadGame

        /// <summary>
        /// This method gets the filenames from the universal storage file LbKTileData.sav
        /// </summary>
        /// <param name="device"></param>
        /// <param name="gamer"></param>
        /// <param name="fileNamesOnly"></param>
        public static void LoadGame(StorageDevice device, SignedInGamer gamer, bool fileNamesOnly)
        {
            // Open a storage container.
            // name of container is LbK Storage Device
            IAsyncResult result =
                device.BeginOpenContainer(gamer.Gamertag, null, null);

            // Wait for the WaitHandle to become signaled.
            result.AsyncWaitHandle.WaitOne();

            StorageContainer container = device.EndOpenContainer(result);

            // Close the wait handle.
            result.AsyncWaitHandle.Close();

            string filename = "LbKTileData.sav";

            // Check to see whether the save exists.
            if (!container.FileExists(filename))
            {
                // If not, dispose of the container and return.
                container.Dispose();
                return;
            }

            // Open the file.
            Stream file = container.OpenFile(filename, FileMode.Open);

            // Read the data from the file.
            XmlSerializer serializer = new XmlSerializer(typeof(SaveGameData));
            SaveGameData data = (SaveGameData)serializer.Deserialize(file);

            // Close the file.
            file.Close();

            // Dispose the container.
            container.Dispose();

            // Report the data to the console.
            if (fileNamesOnly)
            {
                fileNames = data.Names;
            }
            else
            {
                position = data.TilePosition;
                type = data.TileType;
                objectNumber = data.TileObjectNumber;
                count = data.TileCount;
                fileNames = data.Names;
            }

            GamePlayScreen.storageDevice = device;
            // load up game with respective device
        }
開發者ID:Harmonickey,項目名稱:AlexCSPortfolio,代碼行數:61,代碼來源:LbKStorageLevelCreation.cs

示例10: LoadGame

        /// <summary>
        /// This method loads a serialized data object
        /// from the StorageContainer for this game.
        /// </summary>
        /// <param name="device"></param>
        public static void LoadGame(StorageDevice device, SignedInGamer gamer)
        {
            // Open a storage container.
            // name of container is LbK Storage Device
            IAsyncResult result =
                device.BeginOpenContainer("LbK Storage Device", null, null);

            // Wait for the WaitHandle to become signaled.
            result.AsyncWaitHandle.WaitOne();

            StorageContainer container = device.EndOpenContainer(result);

            // Close the wait handle.
            result.AsyncWaitHandle.Close();

            string filename = "LbKSavedItems.sav";

            // Check to see whether the save exists.
            if (!container.FileExists(filename))
            {
                // If not, dispose of the container and return.
                container.Dispose();
                nothingLoaded = true;
                return;
            }

            // Open the file.
            Stream file = container.OpenFile(filename, FileMode.Open);

            // Read the data from the file.
            XmlSerializer serializer = new XmlSerializer(typeof(SaveGameData));
            SaveGameData data = (SaveGameData)serializer.Deserialize(file);

            // Close the file.
            file.Close();

            // Dispose the container.
            container.Dispose();

            // Report the data to the console.
            playerName = data.PlayerName;
            level = data.Level;
            score = data.PlayerScore;
            position = new Vector2(data.playerPosition.X, data.playerPosition.Y);
            checkPoint = data.CheckPoint;

            GamePlayScreen.storageDevice = device;
            // load up game with respective device
        }
開發者ID:Harmonickey,項目名稱:AlexCSPortfolio,代碼行數:54,代碼來源:LbKStorage.cs

示例11: Gamer_LoginSuccess

        public static void Gamer_LoginSuccess(object sender, SignedInEventArgs e)
        {
            // set the local gamer to the signedin gamer
            gamer = e.Gamer;

            // begin asynchronously getting the player's profile. Do this because it may take time to get over the network otherwise.
            gamer.BeginGetProfile(endGetProfile, gamer);

            // remove the signedin handler
            SignedInGamer.SignedIn -= signInHandler;
            Console.WriteLine("Gamer: " + gamer.Gamertag + " signed in.");

            int maxNumberOfPlayers = 1;
            NetworkSession.BeginFind(NetworkSessionType.PlayerMatch, maxNumberOfPlayers, null, endFind, session);
        }
開發者ID:Cheezmeister,項目名稱:Chromathud,代碼行數:15,代碼來源:XNANetworking.cs

示例12: SignIn

 public Microsoft.Xna.Framework.GamerServices.Gamer SignIn(string username, string password)
 {
   using (MonoLive monoLive = new MonoLive())
   {
     Result result = monoLive.SignIn(username, password);
     if (result.ok)
     {
       SignedInGamer signedInGamer = new SignedInGamer();
       signedInGamer.Gamertag = result.Gamer.GamerTag;
       signedInGamer.DisplayName = result.Gamer.GamerTag;
       return (Microsoft.Xna.Framework.GamerServices.Gamer) signedInGamer;
     }
   }
   return (Microsoft.Xna.Framework.GamerServices.Gamer) null;
 }
開發者ID:tanis2000,項目名稱:FEZ,代碼行數:15,代碼來源:MonoLiveClient.cs

示例13: client_SignInCompleted

 private void client_SignInCompleted(object sender, MonoGame.Framework.MonoLive.SignInCompletedEventArgs e)
 {
   if (this.SignInCompleted != null && e.Error != null)
   {
     ((IDisposable) e.UserState).Dispose();
     MonoLiveClient.SignInCompletedEventHandler completedEventHandler = this.SignInCompleted;
     MonoLiveClient monoLiveClient = this;
     SignedInGamer signedInGamer = new SignedInGamer();
     signedInGamer.Gamertag = e.Result.Gamer.GamerTag;
     signedInGamer.DisplayName = e.Result.Gamer.GamerTag;
     SignInCompletedEventArgs e1 = new SignInCompletedEventArgs((Microsoft.Xna.Framework.GamerServices.Gamer) signedInGamer);
     completedEventHandler((object) monoLiveClient, e1);
   }
   else
     this.SignInCompleted((object) this, (SignInCompletedEventArgs) null);
 }
開發者ID:tanis2000,項目名稱:FEZ,代碼行數:16,代碼來源:MonoLiveClient.cs

示例14: Update

        public override void Update(GameTime gameTime)
        {
            if (gt == TimeSpan.Zero) gt = gameTime.TotalGameTime;

            if ((gameTime.TotalGameTime - gt).TotalSeconds > 10) // close after 10 seconds
            {
                SignedInGamer sig = new SignedInGamer();
                sig.DisplayName = "MonoGamer";
                sig.Gamertag = "MonoGamer";

                Gamer.SignedInGamers.Add(sig);

                this.Enabled = false;
                Guide.IsVisible = false;
                gt = TimeSpan.Zero;                
            }
            base.Update(gameTime);
        }
開發者ID:GhostTap,項目名稱:MonoGame,代碼行數:18,代碼來源:MonoGameGamerServicesHelper.cs

示例15: Update

 public override void Update(GameTime gameTime)
 {
   if (this.gt == TimeSpan.Zero)
     this.gt = this.last = gameTime.TotalGameTime;
   if ((gameTime.TotalGameTime - this.last).Milliseconds > 100)
   {
     this.last = gameTime.TotalGameTime;
     this.startalpha += (byte) 21;
   }
   if ((gameTime.TotalGameTime - this.gt).TotalSeconds > 5.0)
   {
     string str = WindowsIdentity.GetCurrent().Name;
     if (str.Contains("\\"))
     {
       int startIndex = str.IndexOf("\\") + 1;
       str = str.Substring(startIndex, str.Length - startIndex);
     }
     SignedInGamer signedInGamer = new SignedInGamer();
     signedInGamer.DisplayName = str;
     signedInGamer.Gamertag = str;
     Gamer.SignedInGamers.Add(signedInGamer);
     this.Visible = false;
     this.Enabled = false;
     this.gt = TimeSpan.Zero;
   }
   base.Update(gameTime);
 }
開發者ID:tanis2000,項目名稱:FEZ,代碼行數:27,代碼來源:MonoLiveGuide.cs


注:本文中的Microsoft.Xna.Framework.GamerServices.SignedInGamer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。