Ejemplo n.º 1
0
 public Dialogue(string[] texts, UnityEvent completedEvent,
                 float delay, float scrollSpeed, BubbleSize bubbleSize, float fontSize)
 {
     Texts             = texts;
     Delay             = delay;
     FontSize          = fontSize;
     ScrollIntervalSec = 1.0f / scrollSpeed;
     Size           = DEFAULT_SIZE_MAP[bubbleSize];
     CompletedEvent = completedEvent;
 }
Ejemplo n.º 2
0
        public Cell GenerateBubble(Field field, BubbleSize Size, BubbleColor?Color = null)
        {
            Cell result;
            int  randomRow;
            int  randomCol;

            do
            {
                randomRow = _random.Next(0, field.Height);
                randomCol = _random.Next(0, field.Width);
                if (field.Cells[randomRow, randomCol].Contain == null)
                {
                    int randomColor = _random.Next(0, Enum.GetNames(typeof(BubbleColor)).Length);
                    result = new Cell(randomRow, randomCol, Size, Color ?? (BubbleColor)randomColor);
                    return(result);
                }
            } while (field.Cells[randomRow, randomCol].Contain != null && field.EmptyCells != 0);

            throw new InvalidOperationException("Field is already full.Generation failed");
        }
        internal SLDataSeries Clone()
        {
            var ds = new SLDataSeries(Options.ShapeProperties.listThemeColors);

            ds.ChartType         = ChartType;
            ds.Index             = Index;
            ds.Order             = Order;
            ds.IsStringReference = IsStringReference;
            ds.StringReference   = StringReference.Clone();
            ds.NumericValue      = NumericValue;
            ds.Options           = Options.Clone();

            var keys = DataPointOptionsList.Keys.ToList();

            ds.DataPointOptionsList = new Dictionary <int, SLDataPointOptions>();
            foreach (var index in keys)
            {
                ds.DataPointOptionsList[index] = DataPointOptionsList[index].Clone();
            }

            if (GroupDataLabelOptions != null)
            {
                ds.GroupDataLabelOptions = GroupDataLabelOptions.Clone();
            }

            keys = DataLabelOptionsList.Keys.ToList();
            ds.DataLabelOptionsList = new Dictionary <int, SLDataLabelOptions>();
            foreach (var index in keys)
            {
                ds.DataLabelOptionsList[index] = DataLabelOptionsList[index].Clone();
            }

            ds.BubbleSize = BubbleSize.Clone();
            ds.AxisData   = AxisData.Clone();
            ds.NumberData = NumberData.Clone();

            return(ds);
        }
 public void Init(BubbleType type, BubbleSize size, Vector3 position)
 {
     this.Type          = type;
     this.Size          = size;
     transform.position = position;
 }
Ejemplo n.º 5
0
 public Cell GenerateBubble(Field field, BubbleSize size, BubbleColor?color = null)
 {
     return(new Cell(1, field.Width - 2, size, color));
 }
Ejemplo n.º 6
0
 public Cell GenerateBubble(Field field, BubbleSize Size, BubbleColor?Color = null)
 {
     return(new Cell(0, field.Width - 2, Size, Color));
 }
        internal C.BubbleChartSeries ToBubbleChartSeries(bool IsStylish = false)
        {
            var bcs = new C.BubbleChartSeries();

            bcs.Index = new C.Index {
                Val = Index
            };
            bcs.Order = new C.Order {
                Val = Order
            };

            if (IsStringReference != null)
            {
                bcs.SeriesText = new C.SeriesText();
                if (IsStringReference.Value)
                {
                    bcs.SeriesText.StringReference = StringReference.ToStringReference();
                }
                else
                {
                    bcs.SeriesText.NumericValue = new C.NumericValue(NumericValue);
                }
            }

            if (Options.ShapeProperties.HasShapeProperties)
            {
                bcs.ChartShapeProperties = Options.ShapeProperties.ToChartShapeProperties(IsStylish);
            }

            bcs.InvertIfNegative = new C.InvertIfNegative {
                Val = Options.InvertIfNegative ?? false
            };

            if (DataPointOptionsList.Count > 0)
            {
                var indexlist = DataPointOptionsList.Keys.ToList();
                indexlist.Sort();
                int index;
                for (var i = 0; i < indexlist.Count; ++i)
                {
                    index = indexlist[i];
                    bcs.Append(DataPointOptionsList[index].ToDataPoint(index, IsStylish));
                }
            }

            if ((GroupDataLabelOptions != null) || (DataLabelOptionsList.Count > 0))
            {
                if (GroupDataLabelOptions == null)
                {
                    var gdloptions = new SLGroupDataLabelOptions(new List <Color>());
                    bcs.Append(gdloptions.ToDataLabels(DataLabelOptionsList, true));
                }
                else
                {
                    bcs.Append(GroupDataLabelOptions.ToDataLabels(DataLabelOptionsList, false));
                }
            }

            bcs.Append(AxisData.ToXValues());
            bcs.Append(NumberData.ToYValues());
            bcs.Append(BubbleSize.ToBubbleSize());

            if (Options.bBubble3D != null)
            {
                bcs.Append(new C.Bubble3D {
                    Val = Options.Bubble3D
                });
            }

            return(bcs);
        }