public void SetPopulationCount(Guid tileId, int population) { var client = new RedisClient(); var key = new PeopleKeys().GetPopulationKey(tileId); client.Set(key, population.ToString()); }
public int ReadPopulationCount(Guid tileId) { var client = new RedisClient(); var key = new PeopleKeys ().GetPopulationKey (tileId); var value = client.Get (key); return Convert.ToInt32(value); }
public void Delete(Guid personId) { var client = new RedisClient (); var key = new PeopleKeys ().GetPersonKey (personId); if (client.Exists (key)) client.Del (key); }
public int ReadPopulationCount(Guid tileId) { var client = new RedisClient(); var key = new PeopleKeys().GetPopulationKey(tileId); var value = client.Get(key); return(Convert.ToInt32(value)); }
public void Save(Tile tile, Person[] people) { foreach (var person in people) Save (person); var client = new RedisClient(); var key = new PeopleKeys ().GetPeopleKey (tile.Id); var json = ArrayToJson (people); client.Set(key, json); }
public void Save(Person person) { var client = new RedisClient(); var key = new PeopleKeys ().GetPersonKey (person.Id); var json = person.ToJson (); client.Set(key, json); var idManager = new DataIdManager (); idManager.Add (person); }
public void Delete(Guid personId) { var client = new RedisClient(); var key = new PeopleKeys().GetPersonKey(personId); if (client.Exists(key)) { client.Del(key); } }
public void Save(Person person) { var client = new RedisClient(); var key = new PeopleKeys().GetPersonKey(person.Id); var json = person.ToJson(); client.Set(key, json); var idManager = new DataIdManager(); idManager.Add(person); }
public void Save(Tile tile, Person[] people) { foreach (var person in people) { Save(person); } var client = new RedisClient(); var key = new PeopleKeys().GetPeopleKey(tile.Id); var json = ArrayToJson(people); client.Set(key, json); }
public Person[] Read(Guid tileId) { var client = new RedisClient (); var key = new PeopleKeys ().GetPeopleKey (tileId); if (!client.Exists (key)) return new Person[]{ }; else { var json = client.Get (key); var people = JsonToArray<Person> (json); return people; } }
public Person[] Read(Guid tileId) { var client = new RedisClient(); var key = new PeopleKeys().GetPeopleKey(tileId); if (!client.Exists(key)) { return new Person[] { } } ; else { var json = client.Get(key); var people = JsonToArray <Person> (json); return(people); } }
public void SetPopulationCount(Guid tileId, int population) { var client = new RedisClient(); var key = new PeopleKeys ().GetPopulationKey (tileId); client.Set(key, population.ToString()); }