private static SealedDeckIndex BuildIndex() { var index = new SealedDeckIndex(); foreach (var resource in Folder.ReadAll()) { if (!resource.Name.EndsWith(".dec")) { continue; } var deck = DeckFile.Read(resource.Name, resource.Content); index.Entries[resource.Name] = deck.LimitedCode.GetValueOrDefault(); } WriteIndex(index); return(index); }
public static void Write(Deck deck) { Folder.WriteFile(deck.Name, DeckFile.Write(deck)); }
public static IEnumerable <Deck> ReadDecks() { return(Folder.ReadAll().Select(r => DeckFile.Read(r.Name, r.Content))); }
private static Deck Get(string filename) { var file = Folder.ReadFile(filename); return(DeckFile.Read(filename, file.Content)); }
public static void Write(Deck deck) { var filename = String.Format("{0}.dec", Guid.NewGuid()); Folder.WriteFile(filename, DeckFile.Write(deck)); }