public static PresetDataSource SamplePresets() { PresetDataSource presets = new PresetDataSource(); presets.Push(new Preset(Preset.PresetType.Static, Pose.PresetPoseThinker(), "생각하는 사람", "로뎅")); presets.Push(new Preset(Preset.PresetType.Static, Pose.PresetPoseHeart(), "♡", "-/////-")); presets.Push(new Preset(Preset.PresetType.Static, Pose.PresetPoseOTL(), "OTL", "한송이")); presets.Push(new Preset(Preset.PresetType.Static, Pose.PresetPoseFashionKing(), "패숀왕", "쥬원")); presets.Push(new Preset(Preset.PresetType.Static, Pose.PresetPoseSillyWalker(), "A Silly Walker", "Paul")); return(presets); }
const int RETRY_COUNT = 30; // allow sparse file index up to this public static PresetDataSource UserPresets() { PresetDataSource presets = new PresetDataSource(); int i = 0; int retryCount = RETRY_COUNT; while (retryCount > 0) { try { JSONClass json = (JSONClass)JSONClass.LoadFromFile(string.Format(GameController.SAVE_FILE_NAME_FORMAT, i)); Preset preset = Preset.Deserialize(json, i); presets.Push(preset); retryCount = RETRY_COUNT; } catch { retryCount--; } finally { i++; } } presets.Push(new Preset(Preset.PresetType.NewPresetPlaceHolder)); return(presets); }