-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#31-state-pattern !Заработали состояния
- Loading branch information
Showing
54 changed files
with
2,042 additions
and
537 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/src/main/java/my/neomer/sixtyseconds/GameModeSelectionActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package my.neomer.sixtyseconds; | ||
|
||
import android.content.Intent; | ||
import android.content.pm.ApplicationInfo; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.widget.Button; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
import butterknife.OnClick; | ||
import my.neomer.sixtyseconds.gamemodes.IGameMode; | ||
import my.neomer.sixtyseconds.gamemodes.SinglePlayerGameMode; | ||
import my.neomer.sixtyseconds.gamemodes.SinglePlayerWithRatesGameMode; | ||
import my.neomer.sixtyseconds.helpers.ApplicationResources; | ||
|
||
public class GameModeSelectionActivity extends AppCompatActivity { | ||
|
||
public static final String GAMEMODE_TAG = "GameModeTag"; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_game_mode_selection); | ||
|
||
ApplicationResources.getInstance().setDebug(0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)); | ||
|
||
ApplicationResources.getInstance().loadSounds(this, null); | ||
ButterKnife.bind(this); | ||
} | ||
|
||
@OnClick(R.id.btnSinglePlayerWithRatesGameMode) | ||
void SinglePlayerWithRatesGameMode() { | ||
ApplicationResources.getInstance().playClickSound(); | ||
runGame(new SinglePlayerWithRatesGameMode()); | ||
} | ||
|
||
@OnClick(R.id.btnSinglePlayerGameMode) | ||
void SinglePlayerGameMode() { | ||
ApplicationResources.getInstance().playClickSound(); | ||
runGame(new SinglePlayerGameMode()); | ||
} | ||
|
||
private void runGame(IGameMode gameMode) { | ||
Intent intent = new Intent(this, MainActivity.class); | ||
intent.putExtra(GAMEMODE_TAG, gameMode); | ||
startActivity(intent); | ||
} | ||
|
||
} |
Oops, something went wrong.