public static void Seed(this ICharacterRoster source) { source.Add(new Character() { Name = "Default", Profession = "Fighter", Race = "Human", Intelligence = 55, Strength = 82, Agility = 74, Charisma = 90, Constitution = 55 }); source.Add(new Character() { Name = "Default 2", Profession = "Fighter", Race = "Human", Intelligence = 70, Strength = 82, Agility = 74, Charisma = 90, Constitution = 55 }); }
private void CopyCharacter(ICharacterRoster target, ICharacterRoster source) { target.CharacterName = source.CharacterName; target.Profession = source.Profession; target.Race = source.Race; target.Description = source.Description; target.Attributes = source.Attributes; }
public ICharacterRoster Add(ICharacterRoster character, out string error) { error = ""; var item = CloneCharacter(character); character.Id = _id++; return(character); }
public string Update(int id, ICharacterRoster character) { var existing = GetById(id); if (existing == null) { return("Character not found"); } CopyCharacter(existing, character); return(""); }
public ICharacterRoster[] GetAll() { var items = new ICharacterRoster[_characterRoster.Count()]; var index = 0; foreach (var character in _characterRoster) { items[index++] = character; } return(items); }
public static void Seed(this ICharacterRoster source) { var items = new[] { new Character() { Name = "Katarina", Profession = "Rogue", Race = "Human", Description = "Greatest Assasin", Strength = 60, Intelligence = 60, Agility = 80, Constitution = 50, Charisma = 70, }, new Character() { Name = "Ganda", Profession = "Wizard", Race = "Elf", Description = "White Wizard", Strength = 50, Intelligence = 85, Agility = 35, Constitution = 70, Charisma = 80, }, new Character() { Name = "Saurin", Profession = "Hunter", Race = "Dwarf", Description = "Dark Lord", Strength = 70, Intelligence = 90, Agility = 20, Constitution = 20, Charisma = 50, } }; foreach (var item in items) { source.Add(item); } }
private object CloneCharacter(ICharacterRoster character) { throw new NotImplementedException(); }
internal ICharacterDatabase Add(ICharacterRoster item) { throw new NotImplementedException(); }