Example #1
0
    //Bullet colitions
    private void OnTriggerEnter2D(Collider2D otherCollider)
    {
        LeftLine     myLeftLine   = otherCollider.gameObject.GetComponent <LeftLine>();     //get the sidelines
        RightLine    myRightLine  = otherCollider.gameObject.GetComponent <RightLine>();    //get the sidelines
        BottomLine   myBottomline = otherCollider.gameObject.GetComponent <BottomLine>();   //get the Bottomline
        PlayerScript myPlayer     = otherCollider.gameObject.GetComponent <PlayerScript>(); //get the Player
        EnemyScript  myEnemy      = otherCollider.gameObject.GetComponent <EnemyScript>();  //get the STD


        //if the collliding object is any sideline
        //if the collliding object is any sideline
        if (myRightLine != null)
        {
            MyAudioManager.BallBounce();

            if (MovingStuffVelocity.x > 0)
            {
                MovingStuffVelocity.x *= -1;
            }
            MovingStuffVelocity    = new Vector2(MovingStuffVelocity.x, MovingStuffVelocity.y);
            MovingStuffRB.velocity = MovingStuffVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is bottomline
        if (myLeftLine != null)
        {
            MyAudioManager.BallBounce();

            if (MovingStuffVelocity.x < 0)
            {
                MovingStuffVelocity.x *= -1;
            }
            MovingStuffVelocity    = new Vector2(MovingStuffVelocity.x, MovingStuffVelocity.y);
            MovingStuffRB.velocity = MovingStuffVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is bottomline
        else if (myBottomline != null)
        {
            transform.position = PointOutSideScreen;                     //bullet disappears
            MoveStdBullet      = false;                                  //StopBulletMovement

            myBlinkerTextObject.transform.position = PointOutSideScreen; //transform condom blinking text
            MyBlinkerCounter = 0;
        }
        else if (myPlayer != null)
        {
            MoveStdBullet      = false;              //StopBulletMovement
            transform.position = PointOutSideScreen; //bullet disappears

            //do stuff
            myPlayer.transform.localScale = new Vector2(PlayerScript.PlayerObjectSize.x / 2f, PlayerScript.PlayerObjectSize.y / 2f); //reduce player size by 50%
            PlayerScript.SharpCondomsPlayerSizeCounter = 1;                                                                          //initiate the playersize counter
            StdPongPlayScript.intCurrentPlayerScore   -= 3;                                                                          //reduce player points


            myBlinkerTextObject.transform.position = PointOutSideScreen; //transform condom blinking text
            MyBlinkerCounter = 0;
        }
    }
Example #2
0
        //
        // GET: /BottomLine/

        public ActionResult BottomLine()
        {
            MoneyMadeManager mm = new MoneyMadeManager();
            RoutesEvents     re = new RoutesEvents();
            BottomLine       bl = new BottomLine();

            bl.EventTotal = mm.GetTotalEvents();
            bl.RouteTotal = mm.GetTotalRoute();


            MoneySpentManager ms = new MoneySpentManager();
            ExpenseTotal      et = new ExpenseTotal();

            bl.TotalExpenses    = ms.GetTotalExpenses();
            bl.FinalAmount      = (bl.EventTotal + bl.RouteTotal) - bl.TotalExpenses;
            bl.ProfitPercentage = bl.FinalAmount / (bl.EventTotal + bl.RouteTotal) * 100;

            BottomLineManager blm = new BottomLineManager();

            bl.TotalSpentOnInventory = blm.GetTotalSpentOnInventory("Ices", "Kliens", "Paper Goods", "Cones", "Toppings");
            var amountWithoutInventory = (bl.EventTotal + bl.RouteTotal) - blm.GetTotalSpentOnInventory("Ices", "Kliens", "Paper Goods", "Cones", "Toppings");

            bl.ProfitPercentageFromAmountSpentOnInventory = amountWithoutInventory / (bl.EventTotal + bl.RouteTotal) * 100;
            return(View(bl));
        }
Example #3
0
        void ReleaseDesignerOutlets()
        {
            if (AreaImage != null)
            {
                AreaImage.Dispose();
                AreaImage = null;
            }

            if (ArrowRight != null)
            {
                ArrowRight.Dispose();
                ArrowRight = null;
            }

            if (BottomLine != null)
            {
                BottomLine.Dispose();
                BottomLine = null;
            }

            if (CircleView != null)
            {
                CircleView.Dispose();
                CircleView = null;
            }

            if (NotificationText != null)
            {
                NotificationText.Dispose();
                NotificationText = null;
            }
        }
Example #4
0
        /// <summary>
        /// Draw the border using draw event arguments and specified bounding rectangle.
        /// </summary>
        /// <param name="e">Draw event arguments.</param>
        /// <param name="rect">Bounding rectangle.</param>
        /// <remarks>
        /// This method is for internal use only.
        /// </remarks>
        public void Draw(FRPaintEventArgs e, RectangleF rect)
        {
            IGraphics g = e.Graphics;

            rect.X      *= e.ScaleX;
            rect.Y      *= e.ScaleY;
            rect.Width  *= e.ScaleX;
            rect.Height *= e.ScaleY;

            if (Shadow)
            {
                //int d = (int)Math.Round(ShadowWidth * e.ScaleX);
                //Pen pen = e.Cache.GetPen(ShadowColor, d, DashStyle.Solid);
                //g.DrawLine(pen, rect.Right + d / 2, rect.Top + d, rect.Right + d / 2, rect.Bottom);
                //g.DrawLine(pen, rect.Left + d, rect.Bottom + d / 2, rect.Right + d, rect.Bottom + d / 2);

                float d     = ShadowWidth * e.ScaleX;
                Brush brush = e.Cache.GetBrush(ShadowColor);
                g.FillRectangle(brush, rect.Left + d, rect.Bottom, rect.Width, d);
                g.FillRectangle(brush, rect.Right, rect.Top + d, d, rect.Height);
            }

            if (Lines != BorderLines.None)
            {
                // draw full frame as a rectangle with solid line only. Non-solid lines
                // should be drawn separately to avoid overlapping effect
                if (Lines == BorderLines.All && LeftLine.Equals(TopLine) && LeftLine.Equals(RightLine) &&
                    LeftLine.Equals(BottomLine) && LeftLine.Style == LineStyle.Solid)
                {
                    Pen pen = e.Cache.GetPen(LeftLine.Color, (int)Math.Round(LeftLine.Width * e.ScaleX), LeftLine.DashStyle);
                    g.DrawRectangle(pen, rect.Left, rect.Top, rect.Width, rect.Height);
                }
                else
                {
                    if ((Lines & BorderLines.Left) != 0)
                    {
                        LeftLine.Draw(e, rect.Left, rect.Top, rect.Left, rect.Bottom,
                                      true, (Lines & BorderLines.Top) != 0, (Lines & BorderLines.Bottom) != 0);
                    }
                    if ((Lines & BorderLines.Right) != 0)
                    {
                        RightLine.Draw(e, rect.Right, rect.Top, rect.Right, rect.Bottom,
                                       false, (Lines & BorderLines.Top) != 0, (Lines & BorderLines.Bottom) != 0);
                    }
                    if ((Lines & BorderLines.Top) != 0)
                    {
                        TopLine.Draw(e, rect.Left, rect.Top, rect.Right, rect.Top,
                                     true, (Lines & BorderLines.Left) != 0, (Lines & BorderLines.Right) != 0);
                    }
                    if ((Lines & BorderLines.Bottom) != 0)
                    {
                        BottomLine.Draw(e, rect.Left, rect.Bottom, rect.Right, rect.Bottom,
                                        false, (Lines & BorderLines.Left) != 0, (Lines & BorderLines.Right) != 0);
                    }
                }
            }
        }
Example #5
0
        /// <inheritdoc/>
        public override bool Equals(object obj)
        {
            Border b = obj as Border;

            return(b != null && Lines == b.Lines &&
                   LeftLine.Equals(b.LeftLine) && TopLine.Equals(b.TopLine) &&
                   RightLine.Equals(b.RightLine) && BottomLine.Equals(b.BottomLine) &&
                   Shadow == b.Shadow && ShadowColor == b.ShadowColor && ShadowWidth == b.ShadowWidth);
        }
        /// <summary>
        /// Write the fragment with selected text to a string-builder
        /// </summary>
        /// <param name="stringBuilder"></param>
        public override void Write(StringBuilder stringBuilder)
        {
            stringBuilder.Append("<br><pre>");
            stringBuilder.Append(TopLine.Substring(0, StartCharOffset - 1));
            stringBuilder.Append(Text);
            var substring = BottomLine.Substring(EndCharOffset - 1);

            stringBuilder.Append(substring);
            stringBuilder.Append("</pre>");
        }
Example #7
0
        public void GetCornerOrientation(Tile right, Tile bottom)
        {
            //RightHandMatch
            var index      = 0;
            var rightIndex = 0;

            while (RightLine != new string(right.LeftLine.ToCharArray().Reverse().ToArray()))
            {
                RotationSetUp(index);
                right.RotationSetUp(rightIndex);

                if (index % 12 == 11)
                {
                    rightIndex++;
                }

                index++;
            }

            index = 0;
            var bottomIndex = 0;

            while (bottom.TopLine != new string(BottomLine.ToCharArray().Reverse().ToArray()))
            {
                switch (index % 2)
                {
                case 0:
                    FlipHorizontal = false;
                    FlipVertical   = false;
                    break;

                case 1:
                    FlipHorizontal = false;
                    FlipVertical   = true;
                    break;
                }

                bottom.RotationSetUp(bottomIndex);
                if (index % 2 == 1)
                {
                    bottomIndex++;
                }

                index++;
            }
        }
Example #8
0
 /// <summary>
 /// Serializes the border.
 /// </summary>
 /// <param name="writer">Writer object.</param>
 /// <param name="prefix">Border property name.</param>
 /// <param name="c">Another Border to compare with.</param>
 /// <remarks>
 /// This method is for internal use only.
 /// </remarks>
 public void Serialize(FRWriter writer, string prefix, Border c)
 {
     if (Shadow != c.Shadow)
     {
         writer.WriteBool(prefix + ".Shadow", Shadow);
     }
     if (ShadowWidth != c.ShadowWidth)
     {
         writer.WriteFloat(prefix + ".ShadowWidth", ShadowWidth);
     }
     if (ShadowColor != c.ShadowColor)
     {
         writer.WriteValue(prefix + ".ShadowColor", ShadowColor);
     }
     if (!SimpleBorder)
     {
         if (Lines != c.Lines)
         {
             writer.WriteValue(prefix + ".Lines", Lines);
         }
         if (Lines != BorderLines.None || Color != Color.Black)
         {
             if (LeftLine.Equals(RightLine) && LeftLine.Equals(TopLine) && LeftLine.Equals(BottomLine) &&
                 c.LeftLine.Equals(c.RightLine) && c.LeftLine.Equals(c.TopLine) && c.LeftLine.Equals(c.BottomLine))
             {
                 LeftLine.Serialize(writer, prefix, c.LeftLine);
             }
             else
             {
                 LeftLine.Serialize(writer, prefix + ".LeftLine", c.LeftLine);
                 TopLine.Serialize(writer, prefix + ".TopLine", c.TopLine);
                 RightLine.Serialize(writer, prefix + ".RightLine", c.RightLine);
                 BottomLine.Serialize(writer, prefix + ".BottomLine", c.BottomLine);
             }
         }
     }
     else
     {
         LeftLine.Serialize(writer, prefix, c.LeftLine);
     }
 }
Example #9
0
        private int HitTestFrame(Point point)
        {
            int result = 0;

            if (TopLeftGrip.Contains(point))
            {
                result = WM.HTTOPLEFT;
            }
            else if (TopRightGrip.Contains(point))
            {
                result = WM.HTTOPRIGHT;
            }
            else if (BottomLeftGrip.Contains(point))
            {
                result = WM.HTBOTTOMLEFT;
            }
            else if (BottomRightGrip.Contains(point))
            {
                result = WM.HTBOTTOMRIGHT;
            }
            else if (TopLine.Contains(point) || TopGrip.Contains(point))
            {
                result = WM.HTTOP;
            }
            else if (LeftLine.Contains(point) || LeftGrip.Contains(point))
            {
                result = WM.HTLEFT;
            }
            else if (RightLine.Contains(point) || RightGrip.Contains(point))
            {
                result = WM.HTRIGHT;
            }
            else if (BottomLine.Contains(point) || (BottomGrip.Contains(point)))
            {
                result = WM.HTBOTTOM;
            }

            return(result);
        }
Example #10
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     return(Lines.GetHashCode() ^ (Shadow.GetHashCode() + 16) ^ ShadowColor.GetHashCode() ^
            (ShadowWidth.GetHashCode() + 32) ^ (LeftLine.GetHashCode() << 1) ^ (TopLine.GetHashCode() << 2) ^
            (RightLine.GetHashCode() << 3) ^ (BottomLine.GetHashCode() << 4));
 }
Example #11
0
 private bool ShouldSerializeBottomLine()
 {
     return(BottomLine.ShouldSerialize());
 }
Example #12
0
        void ReleaseDesignerOutlets()
        {
            if (AppointmentDetailsView != null)
            {
                AppointmentDetailsView.Dispose();
                AppointmentDetailsView = null;
            }

            if (AppointmentRequestTime != null)
            {
                AppointmentRequestTime.Dispose();
                AppointmentRequestTime = null;
            }

            if (BottomLine != null)
            {
                BottomLine.Dispose();
                BottomLine = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (CircleView != null)
            {
                CircleView.Dispose();
                CircleView = null;
            }

            if (dateLabel != null)
            {
                dateLabel.Dispose();
                dateLabel = null;
            }

            if (descriptionLabel != null)
            {
                descriptionLabel.Dispose();
                descriptionLabel = null;
            }

            if (StatusImage != null)
            {
                StatusImage.Dispose();
                StatusImage = null;
            }

            if (timeLabel != null)
            {
                timeLabel.Dispose();
                timeLabel = null;
            }

            if (TopLine != null)
            {
                TopLine.Dispose();
                TopLine = null;
            }

            if (VideoCallButton != null)
            {
                VideoCallButton.Dispose();
                VideoCallButton = null;
            }
        }
Example #13
0
    //Ball colitions
    private void OnTriggerEnter2D(Collider2D otherCollider)
    {
        // Sidelines mySideline = otherCollider.gameObject.GetComponent<Sidelines>();//get the sidelines
        LeftLine     myLeftLine   = otherCollider.gameObject.GetComponent <LeftLine>();     //get the sidelines
        RightLine    myRightLine  = otherCollider.gameObject.GetComponent <RightLine>();    //get the sidelines
        TopLine      myTopLine    = otherCollider.gameObject.GetComponent <TopLine>();      //get the Topline
        BottomLine   myBottomline = otherCollider.gameObject.GetComponent <BottomLine>();   //get the Bottomline
        PlayerScript myPlayer     = otherCollider.gameObject.GetComponent <PlayerScript>(); //get the Player
        EnemyScript  myEnemy      = otherCollider.gameObject.GetComponent <EnemyScript>();  //get the STD


        //if the collliding object is any sideline
        if (myRightLine != null)
        {
            MyAudioManager.BallBounce();

            if (STDBallVelocity.x > 0)
            {
                STDBallVelocity.x *= -1;
            }
            STDBallVelocity    = new Vector2(STDBallVelocity.x, STDBallVelocity.y);
            STDBallRB.velocity = STDBallVelocity;
            //STDBallSpeedX *= -1;
        }
        if (myLeftLine != null)
        {
            MyAudioManager.BallBounce();

            if (STDBallVelocity.x < 0)
            {
                STDBallVelocity.x *= -1;
            }
            STDBallVelocity    = new Vector2(STDBallVelocity.x, STDBallVelocity.y);
            STDBallRB.velocity = STDBallVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is topline
        else if (myTopLine != null)
        {
            MyAudioManager.BallBounce();

            if (STDBallVelocity.y > 0)
            {
                STDBallVelocity.y *= -1;
            }
            STDBallVelocity    = new Vector2(STDBallVelocity.x, STDBallVelocity.y);
            STDBallRB.velocity = STDBallVelocity;

            StdPongPlayScript.MyEnemyHealth -= .10f;       //reduce the enemy health

            StdPongPlayScript.intCurrentPlayerScore += 10; //increase player points
        }
        //if the collliding object is bottomline
        else if (myBottomline != null)
        {
            MyAudioManager.BallBounce();

            if (STDBallVelocity.y < 0)
            {
                STDBallVelocity.y *= -1;
            }
            STDBallVelocity    = new Vector2(STDBallVelocity.x, STDBallVelocity.y);
            STDBallRB.velocity = STDBallVelocity;


            StdPongPlayScript.MyPlayerHealth -= .05f;      //reduce the player health

            StdPongPlayScript.intCurrentPlayerScore -= 10; //reduce player points
        }
        else if (myPlayer != null)
        {
            MyAudioManager.BallBounce();

            int RandomDirection = Random.Range(1, 3);
            int RandomSlantX    = Random.Range(5, 8);
            int RandomSlantY    = Random.Range(6, 10);

            if (RandomDirection == 1)
            {
                STDBallVelocity = new Vector2(RandomSlantX * -1f, RandomSlantY * 1f);
            }
            else
            {
                STDBallVelocity = new Vector2(RandomSlantX * 1f, RandomSlantY * 1f);
            }

            STDBallRB.velocity = STDBallVelocity;
        }
        else if (myEnemy != null)
        {
            MyAudioManager.BallBounce();

            int RandomDirection = Random.Range(1, 3);
            int RandomSlantX    = Random.Range(5, 8);
            int RandomSlantY    = Random.Range(6, 10);

            if (RandomDirection == 1)
            {
                STDBallVelocity = new Vector2(RandomSlantX * -1f, RandomSlantY * -1f);
            }
            else
            {
                STDBallVelocity = new Vector2(RandomSlantX * 1f, RandomSlantY * -1f);
            }

            STDBallRB.velocity = STDBallVelocity;
        }
    }
Example #14
0
    //Bullet colitions
    private void OnTriggerEnter2D(Collider2D otherCollider)
    {
        LeftLine     myLeftLine   = otherCollider.gameObject.GetComponent <LeftLine>();     //get the sidelines
        RightLine    myRightLine  = otherCollider.gameObject.GetComponent <RightLine>();    //get the sidelines
        BottomLine   myBottomline = otherCollider.gameObject.GetComponent <BottomLine>();   //get the Bottomline
        PlayerScript myPlayer     = otherCollider.gameObject.GetComponent <PlayerScript>(); //get the Player
        EnemyScript  myEnemy      = otherCollider.gameObject.GetComponent <EnemyScript>();  //get the STD


        //if the collliding object is any sideline
        //if the collliding object is any sideline
        if (myRightLine != null)
        {
            MyAudioManager.BallBounce();

            if (MovingStuffVelocity.x > 0)
            {
                MovingStuffVelocity.x *= -1;
            }
            MovingStuffVelocity    = new Vector2(MovingStuffVelocity.x, MovingStuffVelocity.y);
            MovingStuffRB.velocity = MovingStuffVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is bottomline
        if (myLeftLine != null)
        {
            MyAudioManager.BallBounce();

            if (MovingStuffVelocity.x < 0)
            {
                MovingStuffVelocity.x *= -1;
            }
            MovingStuffVelocity    = new Vector2(MovingStuffVelocity.x, MovingStuffVelocity.y);
            MovingStuffRB.velocity = MovingStuffVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is bottomline
        else if (myBottomline != null)
        {
            transform.position = PointOutSideScreen;                     //bullet disappears
            MovePowerUp        = false;                                  //StopBulletMovement

            myBlinkerTextObject.transform.position = PointOutSideScreen; //transform condom blinking text
            MyBlinkerCounter = 0;
        }
        else if (myPlayer != null)
        {
            MovePowerUp        = false;              //StopBulletMovement
            transform.position = PointOutSideScreen; //bullet disappears

            //do stuff
            StdPongPlayScript.MyPlayerHealth        += 0.05f; //increace player immune by 5%
            StdPongPlayScript.intCurrentPlayerScore += 3;     //reduce player points


            myBlinkerTextObject.transform.position = PointOutSideScreen; //transform condom blinking text
            MyBlinkerCounter = 0;


            PlayerPrefs.SetInt("PowerupCount", PlayerPrefs.GetInt("PowerupCount") + 1); //increase the overall count of powerups
        }
    }
Example #15
0
    //Bullet colitions
    private void OnTriggerEnter2D(Collider2D otherCollider)
    {
        LeftLine     myLeftLine   = otherCollider.gameObject.GetComponent <LeftLine>();     //get the sidelines
        RightLine    myRightLine  = otherCollider.gameObject.GetComponent <RightLine>();    //get the sidelines
        BottomLine   myBottomline = otherCollider.gameObject.GetComponent <BottomLine>();   //get the Bottomline
        PlayerScript myPlayer     = otherCollider.gameObject.GetComponent <PlayerScript>(); //get the Player
        EnemyScript  myEnemy      = otherCollider.gameObject.GetComponent <EnemyScript>();  //get the STD


        //if the collliding object is any sideline
        //if the collliding object is any sideline
        if (myRightLine != null)
        {
            MyAudioManager.BallBounce();

            if (MovingStuffVelocity.x > 0)
            {
                MovingStuffVelocity.x *= -1;
            }
            MovingStuffVelocity    = new Vector2(MovingStuffVelocity.x, MovingStuffVelocity.y);
            MovingStuffRB.velocity = MovingStuffVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is bottomline
        if (myLeftLine != null)
        {
            MyAudioManager.BallBounce();

            if (MovingStuffVelocity.x < 0)
            {
                MovingStuffVelocity.x *= -1;
            }
            MovingStuffVelocity    = new Vector2(MovingStuffVelocity.x, MovingStuffVelocity.y);
            MovingStuffRB.velocity = MovingStuffVelocity;
            //STDBallSpeedX *= -1;
        }
        //if the collliding object is bottomline
        else if (myBottomline != null)
        {
            transform.position = PointOutSideScreen; //bullet disappears
            MovePowerUp        = false;              //StopBulletMovement


            myBlinkerTextObject.transform.position = PointOutSideScreen; //transform condom blinking text
            MyBlinkerCounter = 0;
        }
        else if (myPlayer != null)
        {
            MovePowerUp                   = false;                                                                                   //StopBulletMovement
            transform.position            = PointOutSideScreen;                                                                      //bullet disappears
            myPlayer.transform.localScale = new Vector2(PlayerScript.PlayerObjectSize.x * 2f, PlayerScript.PlayerObjectSize.y * 2f); //increase player size by 100%
            PlayerScript.SharpCondomsPlayerSizeCounter = 1;                                                                          //initiate the playersize counter


            myBlinkerTextObject.transform.position = PointOutSideScreen; //transform condom blinking text
            MyBlinkerCounter = 0;
            //do stuff


            PlayerPrefs.SetInt("PowerupCount", PlayerPrefs.GetInt("PowerupCount") + 1); //increase the overall count of powerups
        }
    }