public static Ground Parse(string url) { Dictionary<string, string> tokens = Tokenize(url); if (tokens.Count > 0) { Ground ground = new Ground(); if (tokens.ContainsKey("Ground Name:")) ground.Name = tokens["Ground Name:"]; if (tokens.ContainsKey("Home Team:")) ground.HomeTeam = tokens["Home Team:"]; if (tokens.ContainsKey("Address:")) ground.Address = tokens["Address:"]; if (tokens.ContainsKey("Region:")) ground.Region = tokens["Region:"]; if (tokens.ContainsKey("Country:")) ground.Country = tokens["Country:"]; return ground; } return null; }
public static void Save(FileStore store, Ground ground) { store.Save(ground, ground.Id); }