Example #1
0
 /// <summary>
 /// Start a new game
 /// </summary>
 /// <param name="gameType">Type of the game</param>
 public void StartNewGame(GameType gameType)
 {
     _gameHandler = new GameFlowHandler(gameType);
 }
Example #2
0
        /// <summary>
        /// Loads a game
        /// </summary>
        /// <param name="path">Filename</param>
        /// <returns>True if successful, false if failure</returns>
        public bool LoadGame(string path)
        {
            if (path == "")
                return false;
            if (!File.Exists(path))
                return false;

            bool returnValue = false;
            GameData data = null;

            try
            {
                returnValue = GameFileFunctions.LoadGame(ref data, path);
            }
            catch
            {
                returnValue = false;
            }

            if (!returnValue || data == null)
                return false;

            _gameHandler = new GameFlowHandler(data);

            return true;
        }