public ClassBO GetClassByClassName(string _className) { ClassDO retval = dataContext.GetClassDOByClassName(_className); if (retval == null) { return(null); } return(new ClassBO(retval)); }
public ClassBO GetClass(int _classID) { ClassDO retval = dataContext.GetClassDOByID(_classID); if (retval == null) { return(null); } return(new ClassBO(retval)); }
public int NewUserCharacter(CharacterTransition character, int userID) { // Get data from the class of the character to use in calculations ClassDO _class = dataContext.GetClassDOByClassName(character.Class); // Calculate hit points for the new personal character int hp = (character.ClassLevel * _class.ClassDiceValue); // Adjust the stats for the new personal character based on character level int StatMod(int stat) { if (character.ClassLevel >= 15) { stat = stat + 2; if (stat <= 25) { return(stat); } return(25); } else if (character.ClassLevel >= 10) { stat = stat + 1; if (stat <= 25) { return(stat); } return(25); } return(stat); } // Add the new personal character to the database and retrieve the id in order to display the new character var rv = dataContext.AddUserCharacter(character.Name, character.Class, character.ClassLevel, hp, character.AC, StatMod(character.Strength), StatMod(character.Dexterity), StatMod(character.Constitution), StatMod(character.Intelligence), StatMod(character.Wisdom), StatMod(character.Charisma), character.Description, character.SeriesID_FK, userID); return(rv); }
// Constructor to map a DataAccessLayer object to a BusinessLogicLayer object public ClassBO(ClassDO _classDO) { ClassID = _classDO.ClassID; ClassName = _classDO.ClassName; ClassDiceValue = _classDO.ClassDiceValue; }