Exemplo 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++;
                }
            }
        }
Exemplo n.º 2
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);
                }
            }
        }