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
     });
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        public ICharacterRoster Add(ICharacterRoster character, out string error)
        {
            error = "";
            var item = CloneCharacter(character);

            character.Id = _id++;

            return(character);
        }
Exemplo n.º 4
0
        public string Update(int id, ICharacterRoster character)
        {
            var existing = GetById(id);

            if (existing == null)
            {
                return("Character not found");
            }
            CopyCharacter(existing, character);

            return("");
        }
Exemplo n.º 5
0
        public ICharacterRoster[] GetAll()
        {
            var items = new ICharacterRoster[_characterRoster.Count()];
            var index = 0;

            foreach (var character in _characterRoster)
            {
                items[index++] = character;
            }

            return(items);
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
 private object CloneCharacter(ICharacterRoster character)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 internal ICharacterDatabase Add(ICharacterRoster item)
 {
     throw new NotImplementedException();
 }