本文整理汇总了C#中GameStateManagement.PlayerIndexEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PlayerIndexEventArgs类的具体用法?C# PlayerIndexEventArgs怎么用?C# PlayerIndexEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerIndexEventArgs类属于GameStateManagement命名空间,在下文中一共展示了PlayerIndexEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ControlsMenuEntrySelected
void ControlsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
if (e.PlayerIndex == ControllingPlayer)
{
ScreenManager.AddScreen(new ControlsScreen(), ControllingPlayer);
}
}
示例2: PlayGameMenuEntrySelected
void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
List<GameScreen> screensToLoad = new List<GameScreen>();
screensToLoad.Add(new GameplayScreen(leveli));
//screensToLoad.Add(new TowerScreen(5));
LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, screensToLoad.ToArray());
}
示例3: AvailableSessionMenuEntrySelected
/// <summary>
/// Event handler for when an available session menu entry is selected.
/// </summary>
void AvailableSessionMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
// Which menu entry was selected?
AvailableSessionMenuEntry menuEntry = (AvailableSessionMenuEntry)sender;
AvailableNetworkSession availableSession = menuEntry.AvailableSession;
try
{
// Begin an asynchronous join network session operation.
IAsyncResult asyncResult = NetworkSession.BeginJoin(availableSession,
null, null);
// Activate the network busy screen, which will display
// an animation until this operation has completed.
NetworkBusyScreen busyScreen = new NetworkBusyScreen(asyncResult);
busyScreen.OperationCompleted += JoinSessionOperationCompleted;
ScreenManager.AddScreen(busyScreen, ControllingPlayer);
}
catch (Exception exception)
{
NetworkErrorScreen errorScreen = new NetworkErrorScreen(exception);
ScreenManager.AddScreen(errorScreen, ControllingPlayer);
}
}
示例4: PlayGameMenuEntrySelected
/// <summary>
/// Event handler for when the Play Game menu entry is selected.
/// </summary>
void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
// Tell all the current screens to transition off.
foreach (GameScreen screen in ScreenManager.GetScreens())
screen.ExitScreen();
ScreenManager.AddScreen(new GameplayScreen(), e.PlayerIndex);
}
示例5: hardMenuEntrySelected
/// <summary>
/// Event handler for when the Hard menu entry is selected.
/// </summary>
void hardMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
if (ControllingPlayer == e.PlayerIndex)
{
NarlyGame.difficulty = NarlyGame.Difficulty.Hard;
LoadingScreen.Load(ScreenManager, true, ControllingPlayer,
new GameplayScreen(song));
}
}
示例6: HighScoresEntrySelected
/// <summary>
/// Event handler for when the Play Game menu entry is selected.
/// </summary>
void HighScoresEntrySelected(object sender, PlayerIndexEventArgs e)
{
//LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
// new GameplayScreen());
if (e.PlayerIndex == ControllingPlayer)
{
ScreenManager.AddScreen(new HighScoreScreen(), ControllingPlayer);
}
}
示例7: player_Selected
void player_Selected(object sender, PlayerIndexEventArgs e)
{
//this is the correct way
//towersmash.players[(int)e.PlayerIndex] = !towersmash.players[(int)e.PlayerIndex];
//need to be able to test out code solo, this is broken code to be used only for testing
towersmash.players[i] = true;
i++;
SetText();
}
示例8: SoundMenuEntrySelected
private void SoundMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
_soundVolme++;
if (_soundVolme > 10)
_soundVolme = 0;
MediaPlayer.Volume = (float) _soundVolme/10;
SetMenuEntryText();
}
示例9: QuitGameMenuEntrySelected
/// <summary>
/// Event handler for when the Quit Game menu entry is selected.
/// </summary>
void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
const string message = "Are you sure you want to quit this game?";
MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);
confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;
ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
}
示例10: PlayMenuEntrySelected
/// <summary>
/// Event handler for when the Play Game menu entry is selected.
/// </summary>
void PlayMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
const string message = "PlayBack Functionality is not implemented yet.";
MessageBoxScreen playMessageBox = new MessageBoxScreen(message);
playMessageBox.Accepted += PlayMessageBoxAccepted;
ScreenManager.AddScreen(playMessageBox, e.PlayerIndex);
// LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
// new GameplayScreen());
}
示例11: easyMenuEntrySelected
/// <summary>
/// Event handler for when the Easy menu entry is selected.
/// </summary>
void easyMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
if (e.PlayerIndex == ControllingPlayer)
{
NarlyGame.difficulty = NarlyGame.Difficulty.Easy;
//ScreenManager.AddScreen(new SongSelectionScreen(), e.PlayerIndex);
LoadingScreen.Load(ScreenManager, true, ControllingPlayer,
new GameplayScreen(song));
}
}
示例12: ConfirmQuitMessageBoxAccepted
/// <summary>
/// Event handler for when the user selects ok on the "are you sure
/// you want to quit" message box. This uses the loading screen to
/// transition from the game back to the main menu screen.
/// </summary>
void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
{
Screen[] screens = ScreenManager.GetScreens();
foreach (Screen screen in screens)
{
if (screen is PinEditScreen)
{
ScreenManager.RemoveScreen(screen);
}
}
ScreenManager.AddScreen(new PhotoSetMenuScreen(), null);
this.ExitScreen();
}
示例13: saveEntry_Selected
void saveEntry_Selected(object sender, PlayerIndexEventArgs e)
{
Screen[] screens = ScreenManager.GetScreens();
foreach (Screen screen in screens)
{
if (screen is PinEditScreen)
{
((PinEditScreen)screen).SavePins();
}
}
OnCancel(sender, e);
}
示例14: start_Selected
void start_Selected(object sender, PlayerIndexEventArgs e)
{
towersmash.updatenumberofplayers();
//if (counter > 1)
{
base.OnCancel(sender, e);
LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new pvp(ScreenManager));
}
//else
//{
// MessageBoxScreen messagebox = new MessageBoxScreen("Must have at least 2 players ready for battle!");
// ScreenManager.AddScreen(messagebox, null);
//}
}
示例15: exitMenuEntrySelected
void exitMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
if (!(this.keyboardEnabled || this.kinectEnabled))
{
QuestionMenuScreen question = new QuestionMenuScreen("At least one input must be enabled.", new string[] { "Ok" });
ScreenManager.AddScreen(question, null);
}
else
{
ProgramSettings.ChangeSetting(Setting.KeyboardEnabled, this.keyboardEnabled.ToString());
ProgramSettings.ChangeSetting(Setting.KinectEnabled, this.kinectEnabled.ToString());
this.ExitScreen();
}
}