diff options
author | Gormogon <Gormogon@users.noreply.github.com> | 2016-05-29 16:13:24 -0400 |
---|---|---|
committer | Gormogon <Gormogon@users.noreply.github.com> | 2016-05-29 16:13:24 -0400 |
commit | 625f9c89e4db470c0325b5d148c5286c1b5e54eb (patch) | |
tree | 31076fbf57cbbc993abca39eef7bc48762505754 /StardewModdingAPI/Inheritance/SGame.cs | |
parent | 9503dfb94b432b1e6e268dc415327eec507a70c2 (diff) | |
download | SMAPI-625f9c89e4db470c0325b5d148c5286c1b5e54eb.tar.gz SMAPI-625f9c89e4db470c0325b5d148c5286c1b5e54eb.tar.bz2 SMAPI-625f9c89e4db470c0325b5d148c5286c1b5e54eb.zip |
Take advantage of some new language opportunities.
Diffstat (limited to 'StardewModdingAPI/Inheritance/SGame.cs')
-rw-r--r-- | StardewModdingAPI/Inheritance/SGame.cs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs index 5597e463..9b69434a 100644 --- a/StardewModdingAPI/Inheritance/SGame.cs +++ b/StardewModdingAPI/Inheritance/SGame.cs @@ -506,8 +506,7 @@ namespace StardewModdingAPI.Inheritance //this.checkForEscapeKeys();
updateMusic();
updateRaindropPosition();
- if (bloom != null)
- bloom.tick(gameTime);
+ bloom?.tick(gameTime);
if (globalFade)
{
if (!dialogueUp)
@@ -559,8 +558,7 @@ namespace StardewModdingAPI.Inheritance if (pauseThenDoFunctionTimer <= 0)
{
freezeControls = false;
- if (afterPause != null)
- afterPause();
+ afterPause?.Invoke();
}
}
if (gameMode == 3 || gameMode == 2)
@@ -657,8 +655,8 @@ namespace StardewModdingAPI.Inheritance currentMinigame.releaseLeftClick(getMouseX(), getMouseY());
foreach (Buttons b in Utility.getPressedButtons(oldPadState, state3))
currentMinigame.receiveKeyRelease(Utility.mapGamePadButtonToKey(b));
- if (state3.IsConnected && state3.IsButtonDown(Buttons.A) && currentMinigame != null)
- currentMinigame.leftClickHeld(0, 0);
+ if (state3.IsConnected && state3.IsButtonDown(Buttons.A))
+ currentMinigame?.leftClickHeld(0, 0);
}
if (currentMinigame == null)
{
@@ -774,8 +772,7 @@ namespace StardewModdingAPI.Inheritance if (gameMode == 10)
UpdateOther(gameTime);
}
- if (audioEngine != null)
- audioEngine.Update();
+ audioEngine?.Update();
if (multiplayerMode == 2 && gameMode == 3)
server.sendMessages(gameTime);
}
|