Changeset 4666fae in advance-wars for src/com/medievaltech/advancewars/Game.java
- Timestamp:
- Oct 20, 2011, 3:25:50 PM (13 years ago)
- Branches:
- master
- Children:
- bb2fa26
- Parents:
- 331d180
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/advancewars/Game.java
r331d180 r4666fae 9 9 import android.view.MenuItem; 10 10 import android.view.Window; 11 import android.widget.TextView;12 11 13 import com.medievaltech.advancewars.GameView.*;14 12 import com.medievaltech.advancewars.Enum.*; 15 13 16 14 public class Game extends Activity { 17 public DrawingThread mThread; 18 private GameView mGameView; 19 15 20 16 /** 21 17 * Invoked during init to give the Activity a chance to set up its Menu. … … 47 43 48 44 if(i == MenuOption.END_TURN.ordinal()) { 49 mThread.mTurn = Turn.ENEMY_TURN;45 Static.turn = Turn.ENEMY_TURN; 50 46 }else if(i == MenuOption.SAVE.ordinal()) { 51 47 try { … … 57 53 } 58 54 }else if(i == MenuOption.MAIN.ordinal()) { 59 mThread.mGameState = GameState.MAIN_MENU;55 Static.gameState = GameState.MAIN_MENU; 60 56 }else if(i == MenuOption.EXIT.ordinal()) { 61 57 finish(); … … 85 81 setContentView(R.layout.main); 86 82 87 mGameView = (GameView) findViewById(R.id.lunar); 88 mThread = mGameView.getThread(); 89 mGameView.mGame = this; 90 91 mGameView.setTextView((TextView) findViewById(R.id.text)); 83 Static.game = this; 92 84 93 85 if (savedInstanceState == null) { // we were just launched: set up a new game … … 96 88 Log.w("AdvanceWars", "SIS is nonnull"); 97 89 98 mGameView.getThread().mGameState = (GameState)savedInstanceState.getSerializable("gameState");90 Static.gameState = (GameState)savedInstanceState.getSerializable("gameState"); 99 91 } 100 92 } … … 108 100 @Override 109 101 protected void onSaveInstanceState(Bundle outState) { 110 outState.putSerializable("gameState", mGameView.getThread().mGameState);102 outState.putSerializable("gameState", Static.gameState); 111 103 112 104 super.onSaveInstanceState(outState);
Note:
See TracChangeset
for help on using the changeset viewer.