public Result <EntityGroups> GetEntityGroups() { if (_entityGroups == null) { var config = new EntityGroupsFile(_gamePaths); _entityGroups = _gameDataRepository.GetConfigData(config); _entityGroups = _linkerFactory.GetLinker(_entityGroups).Link(_entities); } return(Result.Ok(_entityGroups)); }
public void GetMapper_EntityGroups_Returns_EntityGroupsMapper() { //Arrange var mapperFactory = new MapperFactory(_entitiesMapper.Object, _entityGroupsMapper.Object); var config = new EntityGroupsFile(_gamePaths.Object); //Act var mapper = mapperFactory.GetMapper(config); //Assert Assert.IsInstanceOfType(mapper, typeof(IMapper <entitygroups, EntityGroups>)); }
public void GetConfigData_EntityGroups() { //Arrange var testPaths = new TestPaths(); var configFile = new EntityGroupsFile(testPaths); var gameDataRepository = GetGameDataRepository(); //Act var entityGroups = gameDataRepository.GetConfigData(configFile); //Assert Assert.IsNotNull(entityGroups); Assert.IsTrue(entityGroups.Count > 0); }
public Result Save <T>(T data, string fullPath = null) { switch (data) { case Entities d: var entitiesConfig = new EntityClassesFile(_gamePaths); _gameDataRepository.SaveConfigData(entitiesConfig, d, fullPath); break; case EntityGroups d: var entityGroupsConfig = new EntityGroupsFile(_gamePaths); _gameDataRepository.SaveConfigData(entityGroupsConfig, d, fullPath); break; } return(Result.Ok()); }