Esempio n. 1
0
        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++;
                }
            }
        }
Esempio n. 2
0
 public RandomUnitConfigGenerator(UnitConfigurationsData configData,
                                  UnitColorToShapeDataAccess colorToShapeMapDataAccess,
                                  GameSettings gameSettings, CompositeDisposable disposable)
 {
     _configData = configData;
     _colorToShapeMapDataAccess = colorToShapeMapDataAccess;
     _gameSettings = gameSettings;
     _disposable   = disposable;
 }
Esempio n. 3
0
        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);
                }
            }
        }