/// <summary> /// Generates the dto from game base stat. /// </summary> /// <param name="baseStat">The base stat.</param> /// <returns></returns> public static BaseStatDTO GenerateDTOFromGameBaseStat(GameCharacterBaseStat baseStat) { return(new BaseStatDTO() { ID = baseStat.BaseStatID, Name = baseStat.BaseStat.Name, Value = baseStat.Value, LastEdited = baseStat.EditedDate ?? baseStat.CreatedDate }); }
/// <summary> /// Adds the specified template characters to the given game. /// </summary> /// <param name="gameID">The game identifier.</param> /// <param name="characterIDsToAdd">The character ids to add.</param> public void Add(int gameID, List <int> characterIDsToAdd) { foreach (var id in characterIDsToAdd) { var templateCharacter = TemplateCharacter.Get(context, id); var gameCharacter = GameCharacter.Add(context, templateCharacter, gameID); foreach (var baseStat in templateCharacter.BaseStats) { GameCharacterBaseStat.Add(context, baseStat, gameCharacter); } } }