Example #1
0
		public Game( int width, int height )
		{
			radius = new Radius( this );
			plans = new Plans( this );
			frontier = new Frontier( this );

			this.width = width;
			this.height = height;

			grid = new Case[ width, height ];

			for ( int x = 0; x < width; x ++ )
				for ( int y = 0; y < height; y ++ )
					grid[ x, y ] = new Case( x, y );
		}
 internal _MixedBorderRadius(
     Radius _topLeft,
     Radius _topRight,
     Radius _bottomLeft,
     Radius _bottomRight,
     Radius _topStart,
     Radius _topEnd,
     Radius _bottomStart,
     Radius _bottomEnd)
 {
     this._topLeft     = _topLeft;
     this._topRight    = _topRight;
     this._bottomLeft  = _bottomLeft;
     this._bottomRight = _bottomRight;
     this._topStart    = _topStart;
     this._topEnd      = _topEnd;
     this._bottomStart = _bottomStart;
     this._bottomEnd   = _bottomEnd;
 }
Example #3
0
 public override Widget build(BuildContext context)
 {
     return(new Container(
                decoration: new BoxDecoration(
                    borderRadius: BorderRadius.all(Radius.circular(Height / 2)),
                    boxShadow: new List <BoxShadow>
     {
         new BoxShadow(
             color: Colors.black.withOpacity(0.2f),
             blurRadius: Height / 5,
             offset: new Offset(0, 0)
             )
     }
                    ),
                child: Child,
                margin: Margin is null ? EdgeInsets.all(Height / 5) : Margin,
                padding: Padding
                ));
 }
Example #4
0
        public override void Destroying()
        {
            ((SoundBuffer <T>)DataAssetCache <T> .Instance.GetAsset(typeof(SoundBuffer <T>), "AsteroidExplosion")).PlayAnAvailableCopy();
            if (Radius.GreaterThan(MinSplitRadius))
            {
                PlayerSaveInfo <T> .GetPlayerInfo().Score += this.Radius.Multiply(20).ToDouble();

                Random   rand    = new Random();
                Rock <T> newRock = new Rock <T>(this.Radius.Divide(2), m_RockList);
                newRock.Position    = this.Position;
                newRock.m_MaxDamage = this.MaxDamage.Divide(2);
                m_RockList.Add(newRock);
                newRock             = new Rock <T>(this.Radius.Divide(2), m_RockList);
                newRock.Position    = this.Position;
                newRock.m_MaxDamage = this.MaxDamage.Divide(2);
                newRock.m_Velocity.Set(M.New <T>(rand.NextDouble() * 200), M.New <T>(rand.NextDouble() * 200));
                m_RockList.Add(newRock);
            }
        }
Example #5
0
    Radius GetRadius(Node n)
    {
        float x, y;

        LengthFromParent(out x, out y, parent, n);

        Radius result = 0;

        if (x == 0 && y == 1 || x == 1 && y == 0)
        {
            result = Radius.IsSide;
        }
        if (x == 1 && y == 1)
        {
            result = Radius.IsRoud;
        }

        return(result);
    }
    private float RadiusSet(Radius rad)
    {
        float angle = 0;

        if (rad == Radius.Pi)
        {
            angle = -Mathf.PI;
        }
        else if (rad == Radius.PiOver2)
        {
            angle = Mathf.PI / 2;
        }
        else if (rad == Radius.PiTimes2)
        {
            angle = Mathf.PI * 2;
        }

        return(angle);
    }
Example #7
0
        /// <summary>
        /// Converts object to the string of the format specified.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="formatProvider"></param>
        /// <returns></returns>
        protected override string ToStringInternal(string format, IFormatProvider formatProvider)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Circle(")
            .Append("p=")
            .Append(Center.ToString(format, formatProvider))
            .Append(",r=")
            .Append(Radius.ToString(format, formatProvider))
            .Append(",w=")
            .Append(LineWidth?.ToString(format, formatProvider) ?? "null")
            .Append(",c=")
            .Append(Color ?? "null")
            .Append(",f=")
            .Append(Fill?.ToString(formatProvider).ToLower() ?? "null")
            .Append(')');

            return(sb.ToString());
        }
Example #8
0
        public override XmlElement GetInXML(XmlDocument doc)
        {
            XmlElement shapeElm  = doc.CreateElement("shape");
            XmlElement elem      = doc.CreateElement("sphere");
            XmlElement pointElem = point.GetInXML(doc);
            XmlElement matElem   = material.GetInXML(doc);
            XmlElement radElem   = doc.CreateElement("radius");


            XmlText eText = doc.CreateTextNode(Radius.ToString());

            radElem.AppendChild(eText);
            elem.AppendChild(radElem);
            elem.AppendChild(matElem);
            elem.AppendChild(pointElem);
            shapeElm.AppendChild(elem);

            return(shapeElm);
        }
Example #9
0
        BorderRadius _borderRadius(int index, bool start, bool end)
        {
            D.assert(MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft ==
                     MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topRight);
            D.assert(MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft ==
                     MaterialConstantsUtils.kMaterialEdges[MaterialType.card].bottomLeft);
            D.assert(MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft ==
                     MaterialConstantsUtils.kMaterialEdges[MaterialType.card].bottomRight);

            Radius cardRadius  = MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft;
            Radius startRadius = Radius.zero;
            Radius endRadius   = Radius.zero;

            if (index > 0 && this._children[index - 1] is MaterialGap)
            {
                startRadius = Radius.lerp(
                    Radius.zero,
                    cardRadius,
                    this._animationTuples[this._children[index - 1].key].startAnimation.value);
            }

            if (index < this._children.Count - 2 && this._children[index + 1] is MaterialGap)
            {
                endRadius = Radius.lerp(
                    Radius.zero,
                    cardRadius,
                    this._animationTuples[this._children[index + 1].key].endAnimation.value);
            }

            if (this.widget.mainAxis == Axis.vertical)
            {
                return(BorderRadius.vertical(
                           top: start?cardRadius: startRadius,
                           bottom: end ? cardRadius : endRadius));
            }
            else
            {
                return(BorderRadius.horizontal(
                           left: start?cardRadius: startRadius,
                           right: end ? cardRadius : endRadius));
            }
        }
Example #10
0
        public RenderEditable(TextSpan text, TextDirection textDirection, ViewportOffset offset,
                              ValueNotifier <bool> showCursor,
                              TextAlign textAlign                         = TextAlign.left, float textScaleFactor = 1.0f, Color cursorColor = null,
                              bool?hasFocus                               = null, int?maxLines = 1, Color selectionColor = null,
                              TextSelection selection                     = null, bool obscureText = false, SelectionChangedHandler onSelectionChanged = null,
                              CaretChangedHandler onCaretChanged          = null, bool ignorePointer = false,
                              float cursorWidth                           = 1.0f,
                              Radius cursorRadius                         = null,
                              bool enableInteractiveSelection             = true,
                              TextSelectionDelegate textSelectionDelegate = null)
        {
            D.assert(textSelectionDelegate != null);
            this._textPainter = new TextPainter(text: text, textAlign: textAlign, textDirection: textDirection,
                                                textScaleFactor: textScaleFactor);
            this._cursorColor                = cursorColor;
            this._showCursor                 = showCursor ?? new ValueNotifier <bool>(false);
            this._hasFocus                   = hasFocus ?? false;
            this._maxLines                   = maxLines;
            this._selectionColor             = selectionColor;
            this._selection                  = selection;
            this._obscureText                = obscureText;
            this._offset                     = offset;
            this._cursorWidth                = cursorWidth;
            this._cursorRadius               = cursorRadius;
            this._enableInteractiveSelection = enableInteractiveSelection;
            this.ignorePointer               = ignorePointer;
            this.onCaretChanged              = onCaretChanged;
            this.onSelectionChanged          = onSelectionChanged;
            this.textSelectionDelegate       = textSelectionDelegate;

            D.assert(this._maxLines == null || this._maxLines > 0);
            D.assert(this._showCursor != null);
            D.assert(!this._showCursor.value || cursorColor != null);

            this._tap                   = new TapGestureRecognizer(this);
            this._doubleTap             = new DoubleTapGestureRecognizer(this);
            this._tap.onTapDown         = this._handleTapDown;
            this._tap.onTap             = this._handleTap;
            this._doubleTap.onDoubleTap = this._handleDoubleTap;
            this._longPress             = new LongPressGestureRecognizer(debugOwner: this);
            this._longPress.onLongPress = this._handleLongPress;
        }
Example #11
0
        /// <summary>
        /// Returns the point string value of this instance.
        /// </summary>
        /// <returns>A System.String containing this point.</returns>
        public override string ToString()
        {
            var radius  = Radius.ToString();
            var theta   = Theta.ToString();
            var longStr = string.Format("{0} - {1}", radius, theta);
            var sep     = false;

            if (longStr.IndexOfAny(new[] { ',', ';' }) > -1)
            {
                sep = true;
            }
            if (!sep && longStr.IndexOf(';') > -1)
            {
                const string quoteStr = "\"{0}\"";
                radius = string.Format(quoteStr, radius.Replace("\"", "\\\""));
                theta  = string.Format(quoteStr, theta.Replace("\"", "\\\""));
            }

            return(string.Format("{0} = {1}{2} {3} = {4}", Symbols.RadiusSymbol, radius, sep ? ";" : ",", Symbols.ThetaSymbol, theta));
        }
Example #12
0
 public int CompareTo(ComplexNumber other)
 {
     if (Iszero())
     {
         if (other.Iszero())
         {
             return(0);
         }
         return(other.RealPart != 0 ? -other.RealPart.CompareTo(0.0) : -other.ImaginaryPart.CompareTo(0.0));
     }
     if (other.Iszero())
     {
         return(-other.CompareTo(this));
     }
     if (other.Angle.Equals(Angle))
     {
         return(Radius.CompareTo(other.Radius));
     }
     throw new ArgumentException("cannot compare complexes of different arguments");
 }
Example #13
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(LightColour != null ? LightColour.ToStepValue() : "$");
            parameters.Add(AmbientIntensity != null ? AmbientIntensity.ToStepValue() : "$");
            parameters.Add(Intensity != null ? Intensity.ToStepValue() : "$");
            parameters.Add(Position != null ? Position.ToStepValue() : "$");
            parameters.Add(Radius != null ? Radius.ToStepValue() : "$");
            parameters.Add(ConstantAttenuation != null ? ConstantAttenuation.ToStepValue() : "$");
            parameters.Add(DistanceAttenuation != null ? DistanceAttenuation.ToStepValue() : "$");
            parameters.Add(QuadricAttenuation != null ? QuadricAttenuation.ToStepValue() : "$");
            parameters.Add(Orientation != null ? Orientation.ToStepValue() : "$");
            parameters.Add(ConcentrationExponent != null ? ConcentrationExponent.ToStepValue() : "$");
            parameters.Add(SpreadAngle != null ? SpreadAngle.ToStepValue() : "$");
            parameters.Add(BeamWidthAngle != null ? BeamWidthAngle.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Example #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                isIdentical = true;
                if (textBox1.Text != "" && textBox2.Text != "" && comboBox1.Text != "")
                {
                    row    = int.Parse(textBox1.Text);
                    column = int.Parse(textBox2.Text);
                    if (comboBox1.Text == "175mm")
                    {
                        radius = Radius.large;
                    }
                    else
                    {
                        radius = Radius.small;
                    }

                    this.Close();
                }
            }
            else if (radioButton2.Checked)
            {
                isIdentical = false;
                beamInfo    = new List <unitRow>();
                if (textBox3.Text != "" && comboBox2.Text != "" && textBox4.Text != "" && comboBox3.Text != "")
                {
                    beamInfo.Add(new unitRow(int.Parse(textBox3.Text), ToEnum(comboBox2.Text)));
                    beamInfo.Add(new unitRow(int.Parse(textBox4.Text), ToEnum(comboBox3.Text)));
                    if (textBox5.Text != "" && comboBox4.Text != "")
                    {
                        beamInfo.Add(new unitRow(int.Parse(textBox5.Text), ToEnum(comboBox4.Text)));
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("请至少输入两行数据!");
                }
            }
        }
Example #15
0
    public Capsule(Vector3 <TScalar> axis, TScalar radius, Vector3 <TScalar> position)
    {
        Axis     = axis;
        Position = position;
        Radius   = radius;

        var two = NumberValues.Two <TScalar>();

        _pathLength = Vector3 <TScalar> .Length(axis);

        var twoR = Radius * two;

        Length = _pathLength + twoR;

        var halfHeight = _pathLength / two;

        ContainingRadius = halfHeight + Radius;

        var _halfPath = Vector3 <TScalar> .Normalize(axis) * halfHeight;

        _start = Position - _halfPath;
        _end   = _start + axis;

        var y = Vector3 <TScalar> .UnitY * Radius;

        if (_end.Y >= _start.Y)
        {
            HighestPoint = _end + y;
            LowestPoint  = _start - y;
        }
        else
        {
            HighestPoint = _start + y;
            LowestPoint  = _end - y;
        }

        SmallestDimension = TScalar.Min(Length, twoR);

        Volume = (TScalar.Pi * Radius * Radius * _pathLength)
                 + (NumberValues.FourThirdsPi <TScalar>() * Radius.Cube());
    }
Example #16
0
        public List <string> AsDXFString()
        {
            List <string> entityList = new List <string>();

            entityList.Add("ARC");
            entityList.Add("5");
            entityList.Add(ID.ToString());
            entityList.Add("100");
            entityList.Add("AcDbEntity");
            entityList.Add("8");
            entityList.Add("1");
            entityList.Add("6");
            entityList.Add("SOLID");
            entityList.Add("62");
            entityList.Add((DXFColorConverter.ToDxfColor(Col)).ToString());
            entityList.Add("100");
            entityList.Add("AcDbCircle");
            entityList.Add("10");
            entityList.Add(Center.X.ToString("f5"));
            entityList.Add("20");
            entityList.Add(Center.Y.ToString("f5"));
            entityList.Add("30");
            entityList.Add(Center.Z.ToString("f5"));
            entityList.Add("40");
            entityList.Add(Radius.ToString("f5"));
            entityList.Add("210");
            entityList.Add("0.0");
            entityList.Add("220");
            entityList.Add("0.0");
            entityList.Add("230");
            entityList.Add("1.0");
            entityList.Add("100");
            entityList.Add("AcDbArc");
            entityList.Add("50");
            entityList.Add(StartAngleDeg.ToString("f5"));
            entityList.Add("51");
            entityList.Add(EndAngleDeg.ToString("f5"));
            entityList.Add("0");

            return(entityList);
        }
Example #17
0
        public static double Volume3D(this Radius r, double radiusLength)
        {
            switch (r)
            {
            case SquidGrid.Radius.Square:
            case SquidGrid.Radius.Cube:
                return((radiusLength * 2 + 1) * (radiusLength * 2 + 1) * (radiusLength * 2 + 1));

            case SquidGrid.Radius.Diamond:
            case SquidGrid.Radius.Octahedron:
                double total = radiusLength * (radiusLength + 1) * 2 + 1;
                for (double i = radiusLength - 1; i >= 0; i--)
                {
                    total += (i * (i + 1) * 2 + 1) * 2;
                }
                return(total);

            default:
                return(Math.PI * radiusLength * radiusLength * radiusLength * 4.0 / 3.0 + 1);
            }
        }
        private bool testSenseMap(SourceType algorithm, Radius shape)
        {
            var map = rectResMap(MAP_WIDTH, MAP_HEIGHT);

            // Start out at false
            bool[,] radiusMap = new bool[MAP_WIDTH, MAP_HEIGHT];
            bool[,] losMap    = new bool[MAP_WIDTH, MAP_HEIGHT];

            var los         = new SenseMap(map);
            var lightSource = new SenseSource(algorithm, CENTER, RADIUS_LEGNTH, shape);

            los.AddSenseSource(lightSource);
            los.Calculate();

            for (int x = 0; x < MAP_WIDTH; x++)
            {
                for (int y = 0; y < MAP_HEIGHT; y++)
                {
                    if (los[x, y] > 0)
                    {
                        losMap[x, y] = true;
                    }
                }
            }

            var radArea = new RadiusAreaProvider(CENTER, RADIUS_LEGNTH, shape);

            foreach (var pos in radArea.CalculatePositions())
            {
                radiusMap[pos.X, pos.Y] = true;
            }

            Console.WriteLine("Radius Shape: ");
            printArray(radiusMap);

            Console.WriteLine("LOS Shape: ");
            printArray(losMap);

            return(equivalentArrays(radiusMap, losMap));
        }
Example #19
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.Text == "Circle")
            {
                Radius.Show(); RadiusTextBox.Show();
                Edge1TextBox.Hide(); Edge2TextBox.Hide();
                Edge1.Hide(); Edge2.Hide();
            }
            if (comboBox1.Text == "Rectangle")
            {
                Edge1.Show(); Edge2.Show();
                Edge1TextBox.Show(); Edge2TextBox.Show();
                Radius.Hide(); RadiusTextBox.Hide();
            }

            if (comboBox1.Text == "Select")
            {
                Radius.Hide(); RadiusTextBox.Hide();
                Edge1TextBox.Hide(); Edge2TextBox.Hide();
                Edge1.Hide(); Edge2.Hide();
            }
        }
Example #20
0
        public override void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("Sensor");
            writer.WriteAttributeString("ID", ID.ToString());

            writer.WriteStartElement("Point");
            writer.WriteAttributeString("x", Point.X.ToString());
            writer.WriteAttributeString("y", Point.Y.ToString());
            writer.WriteEndElement();

            writer.WriteElementString("Radius", Radius.ToString());

            XmlSerializerNamespaces ns = new XmlSerializerNamespaces();

            ns.Add("", "");
            var batterySerializer = new XmlSerializer(typeof(Battery));

            batterySerializer.Serialize(writer, Battery, ns);

            writer.WriteEndElement();
            writer.Flush();
        }
Example #21
0
 public override Widget build(BuildContext context)
 {
     return(new AnimatedPadding(
                padding: MediaQuery.of(context).viewInsets + EdgeInsets.symmetric(horizontal: 40.0f, vertical: 24.0f),
                duration: this.insetAnimationDuration,
                curve: this.insetAnimationCurve,
                child: MediaQuery.removeViewInsets(
                    removeLeft: true,
                    removeTop: true,
                    removeRight: true,
                    removeBottom: true,
                    context: context,
                    child: new Center(
                        child: new ConstrainedBox(
                            constraints: new BoxConstraints(280.0f),
                            child: new Column(
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: new List <Widget> {
         this.header ?? new Container(),
         new Container(
             decoration: new BoxDecoration(
                 color: this.backgroundColor,
                 borderRadius: this.header == null
                                         ? BorderRadius.all(Radius.circular((float)this.radius))
                                         : BorderRadius.only(
                     bottomRight: Radius.circular((float)this.radius),
                     bottomLeft: Radius.circular((float)this.radius)
                     )
                 ),
             child: this.child
             )
     }
                                )
                            )
                        )
                    )
                ));
 }
Example #22
0
        public override Widget build(BuildContext context)
        {
            return(new GestureDetector(
                       onTap: () =>
            {
                Navigator.push(context, new MaterialPageRoute(
                                   builder: (context3 => { return new HabitEditor(); })
                                   ));
            },
                       child: new LayoutBuilder(
                           builder: ((buildContext, constraints) =>
            {
                return new Container(
                    constraints: BoxConstraints.tightFor(width: mHabitWidth),
                    height: HabitHeight,
                    padding: EdgeInsets.only(left: 5, top: 3, bottom: 2, right: 5),
                    margin: EdgeInsets.symmetric(horizontal: Habits.Padding / 2, vertical: Habits.VerticalPadding / 2),
                    decoration: new BoxDecoration(
                        color: Colors.white10,
                        borderRadius: BorderRadius.all(Radius.circular(4))
                        ),
                    alignment: Alignment.center,
                    child: new Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: new List <Widget>()
                {
                    new Text("创建习惯",
                             style: new TextStyle(color: Colors.white, fontSize: 16))
                }
                        )
                    );
            })

                           )


                       ));
        }
Example #23
0
        //#region Temporary Field

        //private Point2D _tempTeoricaFinalPnt = null;
        //private Point2D _prevTeoricalPnt = null;

        //#endregion
        protected override void Reset()
        {
            // resetto i valori non UserInputed
            if (!X.IsUserInputed)
            {
                X.SetValue(false, null);
            }

            if (!DeltaX.IsUserInputed)
            {
                DeltaX.SetValue(false, null);
            }

            if (!Y.IsUserInputed)
            {
                Y.SetValue(false, null);
            }

            if (!DeltaY.IsUserInputed)
            {
                DeltaY.SetValue(false, null);
            }

            if (!CenterX.IsUserInputed)
            {
                CenterX.SetValue(false, null);
            }

            if (!CenterY.IsUserInputed)
            {
                CenterY.SetValue(false, null);
            }

            if (!Radius.IsUserInputed)
            {
                Radius.SetValue(false, null);
            }
        }
Example #24
0
        public void InitDefault()
        {
            ArraySize.SetValue(Vector3.One);
            ArrayModulo.SetValue(1);

            var colorAnim = new MyAnimatedPropertyVector4();

            colorAnim.AddKey(0, Vector4.One);
            colorAnim.AddKey(0.33f, Vector4.One);
            colorAnim.AddKey(0.66f, Vector4.One);
            colorAnim.AddKey(1, Vector4.One);
            Color.AddKey(0, colorAnim);

            Velocity.SetValue(new Vector3(0, 0, -1));

            var radiusAnim = new MyAnimatedPropertyFloat();

            radiusAnim.AddKey(0, 0.1f);
            radiusAnim.AddKey(0.33f, 0.1f);
            radiusAnim.AddKey(0.66f, 0.1f);
            radiusAnim.AddKey(1, 0.1f);
            Radius.AddKey(0, radiusAnim);

            Life.SetValue(1);

            StreakMultiplier.SetValue(4);
            AnimationFrameTime.SetValue(1);

            Enabled.SetValue(true);

            ParticlesPerSecond.SetValue(30000);
            Material.SetValue(MyTransparentMaterials.GetMaterial("WhiteBlock"));

            SoftParticleDistanceScale.SetValue(1);
            Bounciness.SetValue(0.5f);

            OITWeightFactor.SetValue(1f);
        }
Example #25
0
 public override Widget build(BuildContext context)
 {
     return(new Container(
                child: new Column(
                    children: new List <Widget>
     {
         AnimatedLottie.file("wine.json", frame: frame, curve: Curves.linear),
         new Container(
             width: 100,
             height: 100,
             decoration: new BoxDecoration(
                 borderRadius: BorderRadius.all(Radius.circular(8))
                 ),
             child: Image.file("test.gif", gaplessPlayback: true)
             ),
         new Container(
             width: 200,
             height: 100,
             decoration: new BoxDecoration(
                 borderRadius: BorderRadius.all(Radius.circular(8))
                 ),
             child: Image.network(
                 "https://unity-cn-cms-prd-1254078910.cos.ap-shanghai.myqcloud.com/assetstore-cms-media/img-7dfe215f-0075-4f9c-9b5a-be5ee88b866b",
                 gaplessPlayback: true)
             ),
         new GestureDetector(
             onTap: () => { setState(() => { frame += 1; }); },
             child: new Container(
                 color: Color.black,
                 padding: EdgeInsets.symmetric(20, 20),
                 child: new Text("Click Me",
                                 style: new TextStyle(fontWeight: FontWeight.w700))
                 )
             )
     }
                    )
                ));
 }
Example #26
0
        public override Widget build(BuildContext context)
        {
            ThemeData theme = Theme.of(context);

            return(new Material(
                       elevation: 2.0f,
                       borderRadius: BorderRadius.only(
                           topLeft: Radius.circular(16.0f),
                           topRight: Radius.circular(16.0f)
                           ),
                       child: new Column(
                           crossAxisAlignment: CrossAxisAlignment.stretch,
                           children: new List <Widget>
            {
                new GestureDetector(
                    behavior: HitTestBehavior.opaque,
                    onVerticalDragUpdate: this.onVerticalDragUpdate,
                    onVerticalDragEnd: this.onVerticalDragEnd,
                    onTap: () => { this.onTap?.Invoke(); },
                    child: new Container(
                        height: 48.0f,
                        padding: EdgeInsetsDirectional.only(start: 16.0f),
                        alignment: AlignmentDirectional.centerStart,
                        child: new DefaultTextStyle(
                            style: theme.textTheme.subtitle1,
                            child: new Tooltip(
                                message: "Tap to dismiss",
                                child: this.title
                                )
                            )
                        )
                    ),
                new Divider(height: 1.0f),
                new Expanded(child: this.child)
            }
                           )
                       ));
        }
Example #27
0
        public IEnumerable <IGenerationInstruction> Generate(IList <Id <Player> > playerIds)
        {
            var idMan = new IdManager();

            var sun = idMan.GetNext <IBody>();

            yield return(new NewFixedBodyInstruction(sun, new Position2(), Radius.FromValue(1), 1));

            var orbitRadius = 7.U();
            var orbitStep   = 4.U();

            foreach (var pId in playerIds)
            {
                var planet = idMan.GetNext <IBody>();

                yield return(new NewOrbitingBodyInstruction(planet, sun,
                                                            Radius.FromValue(orbitRadius), Direction2.Zero, Radius.FromValue(0.5f), 0.25f, 100));

                yield return(new AssignPlayerToBodyInstruction(pId, planet));

                orbitRadius += orbitStep;
            }
        }
Example #28
0
 public ScrollbarPainter(
     Color color,
     TextDirection textDirection,
     double thickness,
     Animation <double> fadeoutOpacityAnimation,
     double mainAxisMargin      = 0.0,
     double crossAxisMargin     = 0.0,
     Radius radius              = null,
     double minLength           = _kMinThumbExtent,
     double minOverscrollLength = _kMinThumbExtent
     )
 {
     this.color                   = color;
     this.textDirection           = textDirection;
     this.thickness               = thickness;
     this.fadeoutOpacityAnimation = fadeoutOpacityAnimation;
     this.mainAxisMargin          = mainAxisMargin;
     this.crossAxisMargin         = crossAxisMargin;
     this.radius                  = radius;
     this.minLength               = minLength;
     this.minOverscrollLength     = minOverscrollLength;
     fadeoutOpacityAnimation.addListener(this.notifyListeners);
 }
Example #29
0
 public CupertinoButton(
     Key key      = null,
     Widget child = null,
     EdgeInsetsGeometry padding = null,
     Color color               = null,
     Color disabledColor       = null,
     float minSize             = 44.0f,
     float pressedOpacity      = 0.4f,
     BorderRadius borderRadius = null,
     VoidCallback onPressed    = null
     ) : base(key: key)
 {
     D.assert((pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
     _filled             = false;
     this.child          = child;
     this.onPressed      = onPressed;
     this.padding        = padding;
     this.color          = color;
     this.disabledColor  = disabledColor ?? CupertinoColors.quaternarySystemFill;
     this.minSize        = minSize;
     this.pressedOpacity = pressedOpacity;
     this.borderRadius   = borderRadius ?? BorderRadius.all(Radius.circular(8.0f));
 }
Example #30
0
        public void paint(Canvas canvas, Rect rect)
        {
            RRect rrect = RRect.fromRectAndRadius(
                rect,
                Radius.circular(rect.shortestSide / 2.0f)
                );

            foreach (BoxShadow shadow in shadows)
            {
                canvas.drawRRect(rrect.shift(shadow.offset), shadow.toPaint());
            }
            canvas.drawRRect(
                rrect.inflate(0.5f),
                new Paint()
            {
                color = CupertinoThumbPainterUtils._kThumbBorderColor
            }
                );
            canvas.drawRRect(rrect, new Paint()
            {
                color = color
            });
        }
Example #31
0
 public override Widget build(BuildContext context)
 {
     return(new Container(
                decoration: new BoxDecoration(
                    borderRadius: BorderRadius.all(Radius.circular(18.0f)),
                    color: this.color == Tab2ConversationBubbleColor.blue
                 ? CupertinoColors.activeBlue
                 : CupertinoColors.lightBackgroundGray
                    ),
                margin: EdgeInsets.symmetric(horizontal: 8.0f, vertical: 8.0f),
                padding: EdgeInsets.symmetric(horizontal: 14.0f, vertical: 10.0f),
                child: new Text(this.text,
                                style: new TextStyle(
                                    color: this.color == Tab2ConversationBubbleColor.blue
                     ? CupertinoColors.white
                     : CupertinoColors.black,
                                    letterSpacing: -0.4f,
                                    fontSize: 15.0f,
                                    fontWeight: FontWeight.w400
                                    )
                                )
                ));
 }
Example #32
0
		public Game()
		{
			radius = new Radius( this );
			plans = new Plans( this );
			frontier = new Frontier( this );
		}
Example #33
0
CP_DefineShapeGetter(cpSegmentShape, double, r, Radius)