public void ExpandTable() { if (_colorToShapeMap.Count <= 0) { return; } _unitConfigurationsData = Resources.Load <UnitConfigurationsData>(Constants.Constants.UnitConfigurationDataPath); int index = 0; foreach (var shapeModel in _unitConfigurationsData.ShapeModels) { foreach (var colorModel in _unitConfigurationsData.ColorModels) { if (index >= _colorToShapeMap.Count) { var colorToShapeMap = new ColorToShapeMapModel() { ColorType = colorModel.ColorType, ShapeType = shapeModel.ShapeType, Atk = 0, Hp = 0 }; _colorToShapeMap.Add(colorToShapeMap); } index++; } } }
public RandomUnitConfigGenerator(UnitConfigurationsData configData, UnitColorToShapeDataAccess colorToShapeMapDataAccess, GameSettings gameSettings, CompositeDisposable disposable) { _configData = configData; _colorToShapeMapDataAccess = colorToShapeMapDataAccess; _gameSettings = gameSettings; _disposable = disposable; }
public void ResetTable() { _unitConfigurationsData = Resources.Load <UnitConfigurationsData>(Constants.Constants.UnitConfigurationDataPath); ColorToShapeMap.Clear(); foreach (var shapeModel in _unitConfigurationsData.ShapeModels) { foreach (var colorModel in _unitConfigurationsData.ColorModels) { var colorToShapeMap = new ColorToShapeMapModel() { ColorType = colorModel.ColorType, ShapeType = shapeModel.ShapeType, Atk = 0, Hp = 0 }; ColorToShapeMap.Add(colorToShapeMap); } } }