private void initialize() { /* start initialize */ ClassEnum choice; int i; String name; Character[] characters = new Character[ Party.MAXPARTY ]; mView = new TextView(); for (i = 0; i < Party.MAXPARTY; i++) {/* start loop */ choice = mView.getClassChoice(); name = mView.getCharacterName(); characters[ i ] = CharacterFactory.getInstance().getCharacter(choice, name); }/* end loop */ mGoodGuys = new Party(characters); mView.GoodGuys = mGoodGuys; mBattle = new Battle(this, mGoodGuys); mDungeon = Dungeon.getInstance(this, mView); mView.Dungeon = mDungeon.GetGrid(); }
// Methods public static Dungeon getInstance(Game game, View view) { if (mDungeon == null) mDungeon = new Dungeon(game, view); return mDungeon; }