// Path: src/com/monead/games/android/sequence/sound/SoundManager.java
// public final class SoundManager {
//     /**
//      * Singleton instance.
//      */
//     private static SoundManager instance;
// 
//     /**
//      * The context for the sounds.
//      */
//     private Context context;
// 
//     /**
//      * Whether sounds should be played.
//      */
//     private boolean soundEnabled;
// 
//     /**
//      * Sound pool for game sounds.
//      */
//     private SoundPool sounds;
// 
//     /**
//      * Relates the sound constants to the SoundPool ids.
//      */
//     private Map<Integer, Integer> soundMap;
// 
//     /**
//      * Constructs an instance and defines the sound pool and map.
//      */
//     private SoundManager() {
//         sounds = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
//         soundMap = new HashMap<Integer, Integer>();
//     }
// 
//     /**
//      * Get the instance.
//      * 
//      * @return The sound manager instance
//      */
//     public static synchronized SoundManager getInstance() {
//         if (instance == null) {
//             instance = new SoundManager();
//         }
// 
//         return instance;
//     }
// 
//     /**
//      * Set the context. This must be called before any sounds can be added.
//      * 
//      * @param pContext
//      *            The context for sound file access
//      */
//     public void setContext(final Context pContext) {
//         context = pContext;
//     }
// 
//     /**
//      * Add a sound to the pool of sounds.
//      * 
//      * @param resourceId
//      *            The resource id for the sound file from the context
//      */
//     public void addSound(final int resourceId) {
//         if (context == null) {
//             throw new IllegalStateException(
//                     "Set context before calling the addSound() method");
//         }
// 
//         soundMap.put(resourceId, sounds.load(context, resourceId, 1));
//     }
// 
//     /**
//      * Play a sound that has been loaded into the sound collection.
//      * 
//      * @param resourceId
//      *            The resource id for the sound
//      */
//     public void play(final int resourceId) {
//         if (isSoundEnabled()) {
//             sounds.play(soundMap.get(resourceId), 1.0f, 1.0f, 0, 0, 1.0f);
//         }
//     }
// 
//     /**
//      * Set the sound mode (on/off).
//      * 
//      * @param pSoundEnabled
//      *            True if sound is on
//      */
//     public void setSoundEnabled(final boolean pSoundEnabled) {
//         soundEnabled = pSoundEnabled;
//     }
// 
//     /**
//      * Get the sound mode (on/off).
//      * 
//      * @return true if sound is on
//      */
//     public boolean isSoundEnabled() {
//         return soundEnabled;
//     }
// }


import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Random;
import com.monead.games.android.sequence.R;
import com.monead.games.android.sequence.sound.SoundManager;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
     * Signal that a game is being restored.
     * 
     * TODO Complete the implementation of the game timer
     */
    public final void signalGameRestored() {
        latestStartupDate = new Date();
        Log.d(className, "signalGameRestored latestStartupDate.getTime ["
                + latestStartupDate.getTime() + "]");
    }

    /**
     * Add a guess to the current try.
     * 
     * @param color
     *            The chosen color
     * 
     * @return True if there was a spot left in the current try for a guess
     */
    public final boolean addGuess(final int color) {
        Log.d(className, "addGuess color [" + color + "]");
        if (!gameStarted) {
            signalGameStart();
        }

        updateElapsedTime();

        if (currentTry < MAX_TRYS_ALLOWED 
                && currentPosit < getSequenceLength()) {
            guess[currentTry][currentPosit] = color;
            ++currentPosit;
// Path: src/com/monead/games/android/sequence/sound/SoundManager.java
// public final class SoundManager {
//     /**
//      * Singleton instance.
//      */
//     private static SoundManager instance;
// 
//     /**
//      * The context for the sounds.
//      */
//     private Context context;
// 
//     /**
//      * Whether sounds should be played.
//      */
//     private boolean soundEnabled;
// 
//     /**
//      * Sound pool for game sounds.
//      */
//     private SoundPool sounds;
// 
//     /**
//      * Relates the sound constants to the SoundPool ids.
//      */
//     private Map<Integer, Integer> soundMap;
// 
//     /**
//      * Constructs an instance and defines the sound pool and map.
//      */
//     private SoundManager() {
//         sounds = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
//         soundMap = new HashMap<Integer, Integer>();
//     }
// 
//     /**
//      * Get the instance.
//      * 
//      * @return The sound manager instance
//      */
//     public static synchronized SoundManager getInstance() {
//         if (instance == null) {
//             instance = new SoundManager();
//         }
// 
//         return instance;
//     }
// 
//     /**
//      * Set the context. This must be called before any sounds can be added.
//      * 
//      * @param pContext
//      *            The context for sound file access
//      */
//     public void setContext(final Context pContext) {
//         context = pContext;
//     }
// 
//     /**
//      * Add a sound to the pool of sounds.
//      * 
//      * @param resourceId
//      *            The resource id for the sound file from the context
//      */
//     public void addSound(final int resourceId) {
//         if (context == null) {
//             throw new IllegalStateException(
//                     "Set context before calling the addSound() method");
//         }
// 
//         soundMap.put(resourceId, sounds.load(context, resourceId, 1));
//     }
// 
//     /**
//      * Play a sound that has been loaded into the sound collection.
//      * 
//      * @param resourceId
//      *            The resource id for the sound
//      */
//     public void play(final int resourceId) {
//         if (isSoundEnabled()) {
//             sounds.play(soundMap.get(resourceId), 1.0f, 1.0f, 0, 0, 1.0f);
//         }
//     }
// 
//     /**
//      * Set the sound mode (on/off).
//      * 
//      * @param pSoundEnabled
//      *            True if sound is on
//      */
//     public void setSoundEnabled(final boolean pSoundEnabled) {
//         soundEnabled = pSoundEnabled;
//     }
// 
//     /**
//      * Get the sound mode (on/off).
//      * 
//      * @return true if sound is on
//      */
//     public boolean isSoundEnabled() {
//         return soundEnabled;
//     }
// }


// Path: src/com/monead/games/android/sequence/model/SequenceHuntGameModel.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Random;
import com.monead.games.android.sequence.R;
import com.monead.games.android.sequence.sound.SoundManager;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;

     * Signal that a game is being restored.
     * 
     * TODO Complete the implementation of the game timer
     */
    public final void signalGameRestored() {
        latestStartupDate = new Date();
        Log.d(className, "signalGameRestored latestStartupDate.getTime ["
                + latestStartupDate.getTime() + "]");
    }

    /**
     * Add a guess to the current try.
     * 
     * @param color
     *            The chosen color
     * 
     * @return True if there was a spot left in the current try for a guess
     */
    public final boolean addGuess(final int color) {
        Log.d(className, "addGuess color [" + color + "]");
        if (!gameStarted) {
            signalGameStart();
        }

        updateElapsedTime();

        if (currentTry < MAX_TRYS_ALLOWED 
                && currentPosit < getSequenceLength()) {
            guess[currentTry][currentPosit] = color;
            ++currentPosit;
            SoundManager.getInstance().play(R.raw.entry);