private void LoadGameDataFile(string file, bool isUserData)
        {
            if (string.IsNullOrWhiteSpace(file) || !File.Exists(file))
            {
                return;
            }

            BaseGameData baseGameData = null;

            try
            {
                baseGameData = BaseGameData.Load(file);
            }
            catch
            {
                // do nothing, just swallow the error
            }

            var gameDataFile = new GameDataFile
            {
                CreatedDate = baseGameData?.Created ?? DateTime.MinValue,
                File        = file,
                FileName    = string.IsNullOrWhiteSpace(file) ? string.Empty : Path.GetFileNameWithoutExtension(file),
                IsUserData  = isUserData,
                Version     = baseGameData?.Version ?? "0.0.0",
                HasError    = baseGameData == null,
            };

            GameDataFiles.Add(gameDataFile);
        }
Пример #2
0
 public RaceXEntity()
 {
     gameData = new RaceXData();
 }
Пример #3
0
 public void SetGameData(BaseGameData data)
 {
     gameData = data;
 }