public Character CreateRandomly(RandomCharacterCreationObject premade, string context) { var hero = _factory.CreateCharacterRandomly(premade, context); _archivist.SaveCharacterAsJson(hero); return(hero); }
public IActionResult CreateRandomly(string game, [FromBody] RandomCharacterCreationObject charac) { if (charac == null) { charac = new RandomCharacterCreationObject(); } _logger.Log("In create randomly with parameter " + charac.Name); //charac.GameName = game; var myCharac = _service.CreateRandomly(game, charac); var response = new CharacterViewModel(myCharac); return(Ok(response)); }
public Character CreateCharacterRandomly(RandomCharacterCreationObject premade, string context) { var _game = _games.SingleOrDefault(x => x.HasName(context)); var charac = new Character(premade); _game.SetCareer(charac, premade.CareerName); _game.SetupCharacter(charac); _game.RandomlySetBaseAttr(charac); _game.SetSpecies(charac, premade.SpeciesName); _game.SetDefaultSpendablePoints(charac); _game.SetDefaultSkills(charac); _game.SetDefaultStats(charac); _game.SetCareerSkills(charac); return(charac); }
public Character CreateRandomly(string contextName, RandomCharacterCreationObject charac) { //var _repo = _repositories.SingleOrDefault(x => x.HasName(contextName)); return(_repo.CreateRandomly(charac, contextName)); }
public Character(RandomCharacterCreationObject premade) : this() { Name = premade.Name; GameName = premade.GameName; }