void Explore(IReadOnlyDictionary<string, string> rpRequests, RawMapExploration rpData) { Cell = new SortieCellInfo(rpData); var rDifficulty = Map.Difficulty; if (!rDifficulty.HasValue) Cell.InternalID = Cell.ID; else { var rDifficultyCount = Enum.GetNames(typeof(EventMapDifficulty)).Length - 1; Cell.InternalID = Cell.ID * rDifficultyCount + (int)rDifficulty.Value - 3; } OnPropertyChanged(nameof(Cell)); }
void InsertCellInfo(int rpMapID, SortieCellInfo rpNode) { using (var rCommand = Connection.CreateCommand()) { rCommand.CommandText = "INSERT OR IGNORE INTO sortie_node(map, id, type, subtype) VALUES(@map, @id, @type, @subtype);"; rCommand.Parameters.AddWithValue("@map", rpMapID); rCommand.Parameters.AddWithValue("@id", rpNode.ID); rCommand.Parameters.AddWithValue("@type", (int)rpNode.EventType); rCommand.Parameters.AddWithValue("@subtype", rpNode.EventSubType); rCommand.ExecuteNonQuery(); } }