public _GAME_MASTER(string _name, bool _have_original) { name = _name; timestamp_hex = GameMasterTimestampUtils.FileNameToHexTimeStamp(name); timestamp_dec = GameMasterTimestampUtils.HexTimeStampToTicks(timestamp_hex); timestamp = GameMasterTimestampUtils.TicksToDateTime(timestamp_dec).ToString(PokeConstants.DateTimeFormat); have_original = _have_original; }
private void numberBox_ValueChanged(object sender, EventArgs e) { if (Working) { return; } try { Working = true; maskedDateTimePicker.Value = checkBoxGameMaster.Checked ? GameMasterTimestampUtils.TicksToDateTime(numberBox.Value) : TimestampUtils.TicksToDateTime(numberBox.Value); } finally { Working = false; } }
private void numberBoxTimeStamp_ValueChanged(object sender, EventArgs e) { // Make sure we aren't in the middle of doing work. if (Working) { return; } try { Working = true; // Convert TimeStamp to DateTime for each. maskedDateTimePickerNormal.Value = TimestampUtils.TicksToDateTime(numberBoxTimeStamp.Value); maskedDateTimePickerGameMaster.Value = GameMasterTimestampUtils.TicksToDateTime(numberBoxTimeStamp.Value); } finally { Working = false; } }
/// <summary> /// Determines whether the specified itemTemplate, from the GAME_MASTER with the specified timestamp, /// contains movesets that should included in the legacy lists. /// </summary> /// <param name="itemTemplate"></param> /// <param name="timestamp"></param> /// <returns></returns> private static bool IsValidItemTemplate(ItemTemplate itemTemplate, ulong timestamp) { // If there is no pokemonSettings, the it doesn't contain MoveSets. if (itemTemplate.pokemon_settings == null) { return(false); } // If baseCaptureRate isn't positive, then it cannot be caught. (Not released) if (itemTemplate.pokemon_settings.encounter.base_capture_rate <= 0) { return(false); } // If is a GAME_MASTER before the one used during the Pokemon's release, just ignore it. if (GetReleaseDate(int.Parse(itemTemplate.template_id.Substring(1, 4))) > GameMasterTimestampUtils.TicksToDateTime(timestamp)) { return(false); } // If we made it here, then it should be used. return(true); }