本文整理汇总了C#中PlayerIndexEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PlayerIndexEventArgs类的具体用法?C# PlayerIndexEventArgs怎么用?C# PlayerIndexEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerIndexEventArgs类属于命名空间,在下文中一共展示了PlayerIndexEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fullscreenMenuEntrySelected
/// <summary>
/// Event handler for when the Frobnicate menu entry is selected.
/// </summary>
void fullscreenMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
sounds.playSoundEffect("select", 1);
fullscreen = !fullscreen;
Game1.changeFullScreen();
SetMenuEntryText();
}
示例2: 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)
{
LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(),
new MainMenuScreen());
//ExitScreen();
}
示例3: DifficultyMenuEntrySelected
/// <summary>
/// Event handler for when the Language menu entry is selected.
/// </summary>
void DifficultyMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
sounds.playSoundEffect("select", 1);
currentDifficulty = (currentDifficulty + 1) % Difficulty.Length;
SetMenuEntryText();
}
示例4: UngulateMenuEntrySelected
/// <summary>
/// Event handler for when the Ungulate menu entry is selected.
/// </summary>
private void UngulateMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
_currentUngulate++;
if (_currentUngulate > Ungulate.Llama)
_currentUngulate = 0;
SetMenuEntryText();
}
示例5: QuitGameMenuEntrySelected
/// <summary>
/// Event handler for when the Quit Game menu entry is selected.
/// </summary>
private 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 += this.ConfirmQuitMessageBoxAccepted;
this.ScreenManager.AddScreen(confirmQuitMessageBox, this.ControllingPlayer);
}
示例6: GameOverBox_Cancelled
void GameOverBox_Cancelled(object sender, PlayerIndexEventArgs e)
{
foreach (var screen in ScreenManager.GetScreens())
{
screen.ExitScreen();
}
ScreenManager.AddScreen(new BackgroundScreen(), null);
ScreenManager.AddScreen(new MainMenuScreen(), null);
}
示例7: 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);
}
示例8: QuitGameMenuEntrySelected
/// <summary>
/// Event handler for when the Quit Game menu entry is selected.
/// </summary>
void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
const string message = "You are about to exit the game\n"+" ...are you sure?";
MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);
confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;
ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
}
示例9: quitMenuEntry_Selected
void quitMenuEntry_Selected(object sender, PlayerIndexEventArgs e)
{
const string message = "Are you sure you want to exit?";
var confirmExitMessageBox = new MessageBoxScreen(message);
confirmExitMessageBox.Accepted += confirmExitMessageBox_Accepted;
ScreenManager.AddScreen(confirmExitMessageBox, e.PlayerIndex);
}
示例10: menuLevel_Selected
void menuLevel_Selected(object sender, PlayerIndexEventArgs e)
{
string fileName = "";
if (sender.GetType() == typeof(LevelMenuEntry))
{
fileName = (sender as LevelMenuEntry).FileName;
}
gamePlayScreen = new SnakeWorld(fileName);
LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
gamePlayScreen);
}
示例11: OnResolutionMenuEntryClick
private void OnResolutionMenuEntryClick(object sender, PlayerIndexEventArgs e)
{
List<ScreenResolution> res = this.Settings.AvailableResolutions();
int index = res.FindIndex(x => x == this.Settings.CurrentResolution);
int totalCount = res.Count;
index = (index >= totalCount - 1) ? 0 : ++index;
this.Settings.SetResolution(res[index]);
this.UpdateScreen();
}
示例12: QuitGameMenuEntrySelected
/// <summary>
/// Evento para quando for escolhido sair do game
/// </summary>
void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
// Mensagem que será colocada na tela
string message = "Confirmar a Saída?";
// Instância de tela popup (message box)
MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message, false);
// Cria o evento para confirmar a saída
confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;
// Adiciona a entrada(item) à coleção do gerenciador de telas
this.ScreenManager.AddScreen(confirmQuitMessageBox, this.ControllingPlayer);
}
示例13: HowToPlayMenuEntrySelected
void HowToPlayMenuEntrySelected(object sender, PlayerIndexEventArgs e)
{
const string msg2 = "Game Controls\n\n" +
"Left Stick: Move\n" +
"Right Stick: Aim\n" +
"Y: Swap weapon\n" +
"Right Trigger: Fire\n" +
"Left Bumper: Reload\n" +
"DPad Left: Buy weapons\n" +
"DPad Right: Mod current weapon";
MessageBoxScreen controlsMessageBox = new MessageBoxScreen(msg2, false);
ScreenManager.AddScreen(controlsMessageBox, e.PlayerIndex);
}
示例14: ConfirmConnectMessageBox
/// <summary>
/// Event handler for when the user selects ok on the "Connect to IP: " message box.
/// </summary>
void ConfirmConnectMessageBox( object sender, PlayerIndexEventArgs e )
{
if ( JoinServerGame ( ) )
{
LoadingScreen.Load ( ScreenManager, true, e.PlayerIndex,
new GamePlayScreen ( ) );
}
else
{
MessageBoxScreen failedToConnectMessageBox = new MessageBoxScreen ( "Failed to connect." );
failedToConnectMessageBox.Accepted += new EventHandler<PlayerIndexEventArgs> ( CloseFailedToConnectMessageBox );
failedToConnectMessageBox.Cancelled += new EventHandler<PlayerIndexEventArgs> ( CloseFailedToConnectMessageBox );
ScreenManager.AddScreen ( failedToConnectMessageBox,e.PlayerIndex );
}
}
示例15: GameOverBox_Accepted
void GameOverBox_Accepted(object sender, PlayerIndexEventArgs e)
{
string currentLevelName = string.Empty;
foreach (var screen in ScreenManager.GetScreens())
{
if (screen is SnakeWorld)
{
currentLevelName = (screen as SnakeWorld).TiledMapName;
}
screen.ExitScreen();
}
gamePlayScreen = new SnakeWorld(currentLevelName);
ScreenManager.AddScreen(gamePlayScreen,ControllingPlayer);
}