public int CreateCharacter(CharacterBLL character) { int proposedReturnValue = -1; proposedReturnValue = _context.CreateCharacter(character.UserID, character.CharacterName, character.ClassID, character.RaceID, character.StrengthScore, character.DexterityScore, character.ConstitutionScore, character.IntelligenceScore, character.WisdomScore, character.CharismaScore); return(proposedReturnValue); }
// orignal code below updated in order to roll 4 dice and drop the low //{ // int diceRoll1 = diceRoll.Next(1, 7); // int diceRoll2 = diceRoll.Next(1, 7); // int diceRoll3 = diceRoll.Next(1, 7); // int diceRoll4 = diceRoll.Next(1, 7); // int totalRoll = (diceRoll1 + diceRoll2 + diceRoll3 + diceRoll4); // return totalRoll; //} public void CharacterModification(CharacterBLL u, List <Modifier> Modifiers) { foreach (Modifier m in Modifiers) { // this switch statement is taking the base stats of a character and adding in the race and class modifiers (if any) to each stat and returning the total value switch ((m.StatID)) { // due to the offset of the stats the cases start at 6 and end at 11 case (6): u.StrengthScore = u.StrengthScore + m.ModifierAmount; break; case (7): u.DexterityScore = u.DexterityScore + m.ModifierAmount; break; case (8): u.ConstitutionScore = u.ConstitutionScore + m.ModifierAmount; break; case (9): u.IntelligenceScore = u.IntelligenceScore + m.ModifierAmount; break; case (10): u.WisdomScore = u.WisdomScore + m.ModifierAmount; break; case (11): u.CharismaScore = u.CharismaScore + m.ModifierAmount; break; } } }
public CharacterBLL FindByCharacterID(int CharacterID) { CharacterBLL proposedReturnValue = null; CharacterDAL DataLayerObject = _context.FindByCharacterID(CharacterID); if (null != DataLayerObject) { proposedReturnValue = new CharacterBLL(DataLayerObject); } return proposedReturnValue; }
public List<CharacterBLL> GetCharactersRelatedToUserID(int UserID, int skip, int take) { List<CharacterBLL> ProposedReturnValue = new List<CharacterBLL>(); List<CharacterDAL> ListOfDataLayerObjects = _context.GetCharactersRelatedToUserID(UserID, skip, take); foreach (CharacterDAL Character in ListOfDataLayerObjects) { CharacterBLL BusinessObject = new CharacterBLL(Character); ProposedReturnValue.Add(BusinessObject); } return ProposedReturnValue; }
public void CharacterModification(CharacterBLL u, List<Modifier> Modifiers) { MeaningfulCalc calc = new MeaningfulCalc(); calc.CharacterModification(u, Modifiers); }
public void DeleteCharacter(CharacterBLL character) { _context.DeleteCharacter(character.CharacterID); }
public void JustUpdateCharacter(CharacterBLL character) { _context.JustUpdateCharacter(character.CharacterID, character.UserID, character.CharacterName, character.ClassID, character.RaceID, character.StrengthScore, character.DexterityScore, character.ConstitutionScore, character.IntelligenceScore, character.WisdomScore, character.CharismaScore, character.UserName, character.ClassName, character.RaceName); }