本文整理汇总了C#中Microsoft.Xna.Framework.GamerServices.SignedInGamer类的典型用法代码示例。如果您正苦于以下问题:C# SignedInGamer类的具体用法?C# SignedInGamer怎么用?C# SignedInGamer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SignedInGamer类属于Microsoft.Xna.Framework.GamerServices命名空间,在下文中一共展示了SignedInGamer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Gamer_LogoutSuccess
public static void Gamer_LogoutSuccess(object sender, SignedOutEventArgs e)
{
Console.WriteLine("Gamer: " + e.Gamer.Gamertag + " signed out.");
// reset gamer
gamer = null;
// add signedin handler
SignedInGamer.SignedIn += signInHandler;
}
开发者ID:Cheezmeister,项目名称:Chromathud,代码行数:10,代码来源:XNANetworking.cs
示例17: profileSelected
void profileSelected ()
{
if (tableView.SelectedRowCount > 0) {
var rowSelected = tableView.SelectedRow;
SignedInGamer sig = new SignedInGamer();
sig.DisplayName = gamerList[rowSelected].DisplayName;
sig.Gamertag = gamerList[rowSelected].Gamertag;
sig.InternalIdentifier = gamerList[rowSelected].PlayerInternalIdentifier;
Gamer.SignedInGamers.Add(sig);
}
MonoGameGamerServicesHelper.SerializeProfiles(gamerList);
NSApp.StopModal();
}
开发者ID:Boerlam001,项目名称:MonoGame,代码行数:14,代码来源:SigninController.cs
示例18: LocalNetworkGamer
public LocalNetworkGamer (NetworkSession session,byte id,GamerStates state)
: base(session, id, state | GamerStates.Local)
{
sig = new SignedInGamer ();
receivedData = new Queue<CommandReceiveData>();
}
开发者ID:GhostTap,项目名称:MonoGame,代码行数:6,代码来源:LocalNetworkGamer.cs
示例19: AddHighscore
/* Add a random highscore. Used to populate the table for testing.
* If there is no signed in gamer, use the word "Guest."
*/
void AddHighscore(SignedInGamer g)
{
AddHighscore((g == null) ? "Guest" : g.Gamertag, false);
}
开发者ID:jpipeperez,项目名称:Software-Portfolio,代码行数:7,代码来源:HighScoreScreen.cs
示例20: Update
public override void Update(GameTime gameTime)
{
if (gt == TimeSpan.Zero) gt = last = gameTime.TotalGameTime;
if ((gameTime.TotalGameTime - last).Milliseconds > 100)
{
last = gameTime.TotalGameTime;
startalpha += 255 / 12;
}
if ((gameTime.TotalGameTime - gt).TotalSeconds > 5) // close after 10 seconds
{
string strUsr = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
if (strUsr.Contains(@"\"))
{
int idx = strUsr.IndexOf(@"\") + 1;
strUsr = strUsr.Substring(idx, strUsr.Length - idx);
}
SignedInGamer sig = new SignedInGamer();
sig.DisplayName = strUsr;
sig.Gamertag = strUsr;
Gamer.SignedInGamers.Add(sig);
this.Visible = false;
this.Enabled = false;
//Guide.IsVisible = false;
gt = TimeSpan.Zero;
}
base.Update(gameTime);
}
开发者ID:GhostTap,项目名称:MonoGame,代码行数:33,代码来源:MonoGameGamerServicesHelper.cs
注:本文中的Microsoft.Xna.Framework.GamerServices.SignedInGamer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论