示例#1
0
        public Bl_imp()
        {
            foreach (var v in FactoryDal.GetDal().GetAllReport())
            {
                int flag = 0;
                foreach (var h in list)
                {
                    if (v.DateRep.Year - h.DateFalling.Year == 0 && v.DateRep.Month - h.DateFalling.Month == 0 && v.DateRep.Day - h.DateFalling.Day == 0 && v.DateRep.Hour - h.DateFalling.Hour == 0)
                    {
                        if (v.DateRep.Minute - h.DateFalling.Minute < 5 && v.DateRep.Minute - h.DateFalling.Minute > -5)
                        {
                            if (g.GetDistanceBetweenPoints(h.CoordinateF, v.CoordinateR) < 2)
                            {
                                flag = 1;
                            }
                        }
                    }
                }

                //if it dosen't find an optenial fall it creat a new one with the details of the first report
                if (flag == 0)
                {
                    Falling f = new Falling(v.City, v.Address, v.DateRep, v.CoordinateR);
                    list.Add(f);
                }
            }
        }
示例#2
0
    // --------------------------------------------------------------

    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            PController playerController = other.gameObject.GetComponent <PController>();
            if (playerController)
            {
                // Kill the player
                playerController.Die();

                // Increase the score for the opposing player
                if (OnPlayerDeath != null)
                {
                    OnPlayerDeath(playerController.GetPlayerNum(false));
                }
            }
        }

        if (other.gameObject.tag == "Falling")
        {
            Falling fall = other.gameObject.GetComponent <Falling>();
            if (fall)
            {
                fall.Die();
            }
        }
    }
    void Awake()
    {
        Text    = GetComponent <TMP_Text>();
        Falling = GetComponent <Falling>();

        Text.text = "MISSING WORD";
    }
示例#4
0
    void Start()
    {
        playerFalling = player.GetComponent <Falling>();
        currLocation  = playerFalling.jumpersLocation[1] - GameController.instance.startingAltitude +
                        GameController.instance.startingHeight;

        startingAnchorGUIHeightX        = new Vector2(height.rectTransform.anchorMin.x, height.rectTransform.anchorMax.x);
        startingAnchorGUIHeightY        = new Vector2(height.rectTransform.anchorMin.y, height.rectTransform.anchorMax.y);
        startingAnchorGUILengthX        = new Vector2(length.rectTransform.anchorMin.x, length.rectTransform.anchorMax.x);
        startingAnchorGUILengthY        = new Vector2(length.rectTransform.anchorMin.y, length.rectTransform.anchorMax.y);
        endLine.rectTransform.anchorMin = new Vector2(0,
                                                      GameController.instance.minHeight / GameController.instance.startingHeight);

        endLine.rectTransform.anchorMax = new Vector2(0.75f,
                                                      GameController.instance.minHeight / GameController.instance.startingHeight);

        warningLine.rectTransform.anchorMin = new Vector2(0,
                                                          GameController.instance.warningHeights[(int)GameController.instance.license] / GameController.instance.startingHeight);

        warningLine.rectTransform.anchorMax = new Vector2(0.75f,
                                                          GameController.instance.warningHeights[(int)GameController.instance.license] / GameController.instance.startingHeight);

        if (GameController.instance.challengeJump)
        {
            deployParachute.gameObject.SetActive(false);
        }
    }
示例#5
0
 public void Start()
 {
     base.Start();
     enemy   = passenger.GetComponent <Enemy>();
     falling = passenger.GetComponent <Falling>();
     player  = FindObjectOfType <Player>();
 }
示例#6
0
        private void checkStates()
        {
            if (dying)
            {
                state = Falling.getFalling();
            }

            if (KeyBoard.fix && onGround && !dying)
            {
                state = Fixing.getFixing();
            }

            if (isImmune && !KeyBoard.fix && !dying)
            {
                state = Immune.getImmune();
            }

            if (getDx() == 0 && getDy() == 0 && !KeyBoard.fix && !isImmune && !dying)
            {
                state = Normal.getNormal();
            }


            if ((getDx() != 0 || getDy() != 0) && !isImmune)
            {
                state = Moving.getMoving();
            }
        }
示例#7
0
        public void OnBlockPlaced(int x, int y, int z, byte block)
        {
            if (!Enabled)
            {
                return;
            }

            int index = (y * length + z) * width + x;

            if (block == (byte)Block.Lava)
            {
                Lava.Enqueue(defLavaTick | (uint)index);
            }
            else if (block == (byte)Block.Water)
            {
                Water.Enqueue(defWaterTick | (uint)index);
            }
            else if (block == (byte)Block.Sand || block == (byte)Block.Gravel)
            {
                Falling.Enqueue(defFallingTick | (uint)index);
            }
            else if (block == (byte)Block.TNT)
            {
                Explode(4, x, y, z);
            }
            else if (block == (byte)Block.Sapling)
            {
                GrowTree(x, y, z);
            }
            else if (block == (byte)Block.Sponge)
            {
                PlaceSponge(x, y, z);
            }
        }
示例#8
0
 public void AddFalling(Falling f)
 {
     using (var db = new MyContext())
     {
         db.Fallings.Add(f);
         db.SaveChanges();
     }
 }
示例#9
0
 public void Drop()
 {
     _myRigid.useGravity  = true;
     enabled              = false;
     _myRigid.isKinematic = false;
     Falling?.Invoke(this, new EventArgs());
     Invoke("Erase", 2F);
 }
示例#10
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     mouseDownPoint = e.Location;
     IsMouseDown    = true;
     if (CurrentAnimation == null || !(CurrentAnimation is Falling))
     {
         CurrentAnimation = new Falling(this);
     }
 }
示例#11
0
 // Use this for initialization
 void Start()
 {
     isWaiting   = true;
     inprocess   = false;
     isPlaying   = false;
     falling     = Smasher.GetComponent <Falling>();
     yresetPoint = startPosition.transform.position.y - .15f;
     audioSource = GetComponent <AudioSource>();
 }
示例#12
0
 public States(Player player)
 {
     this.player = player;
     falling     = new Falling(player);
     walking     = new Walking(player);
     dead        = new Dead(player);
     wallgrab    = new WallGrab(player);
     jump        = new Jump(player);
     doublejump  = new DoubleJump(player);
 }
示例#13
0
    public override Node SetUp_Tree()
    {
        Node idling    = new Idling();
        Node running   = new Running();
        Node crouching = new Crouching();
        Node jumping   = new Jumping();
        Node falling   = new Falling();

        Node nonAttacked = Node_Selector.Create(crouching, running, idling, jumping, falling);

        Node attacked = new Attacked();

        return(Node_Selector.Create(attacked, nonAttacked));
    }
示例#14
0
        public void AddReport(Report r)
        {
            if (r.DateRep > DateTime.Now)
            {
                throw new Exception("The date is not valid");
            }

            if (r.BoomsN <= 0)
            {
                throw new Exception("The number is not valid");
            }

            if (r.Intensity < 1 || r.Intensity > 10)
            {
                throw new Exception("The Intensity is not valid");
            }
            int flag = 0;
            var h    = g.Geocode(r.City, r.Address);

            r.CoordinateR = new Coordinate(h.Latitude, h.Longitude);
            //Console.WriteLine(newReportFall.CoordinateR.Latitude + " " + newReportFall.CoordinateR.Longitude);


            foreach (var v in list)
            {
                if (r.DateRep.Year - v.DateFalling.Year == 0 && r.DateRep.Month - v.DateFalling.Month == 0 && r.DateRep.Day - v.DateFalling.Day == 0 && r.DateRep.Hour - v.DateFalling.Hour == 0)
                {
                    if (r.DateRep.Minute - v.DateFalling.Minute < 5 && r.DateRep.Minute - v.DateFalling.Minute > -5)
                    {
                        if (g.GetDistanceBetweenPoints(r.CoordinateR, v.CoordinateF) < 500)
                        {
                            r.FallId = v.FallId;
                            flag     = 1;
                        }
                    }
                }
            }
            //if it dosen't find an optenial fall it creat a new one with the details of the first report
            if (flag == 0)
            {
                Falling f = new Falling(r.City, r.Address, r.DateRep, r.CoordinateR);
                list.Add(f);
                r.FallId = f.FallId;
            }

            FactoryDal.GetDal().AddReport(r);
        }
示例#15
0
        public void AddFalling(Falling f)
        {
            if (f.DateFalling > DateTime.Now)
            {
                throw new Exception("The date is not valid");
            }
            if (f.CoordinateF.Latitude != 0)
            {
                Console.WriteLine("rfs");
            }
            else
            {
                f.CoordinateF = g.Geocode(f.City, f.Street);
            }

            FactoryDal.GetDal().AddFalling(f);
        }
示例#16
0
        /// <summary>
        /// Initalize the states and add them
        /// </summary>
        protected override void Start()
        {
            base.Start();

            StateMachine = new CharacterStateMachine(this);

            falling  = new Falling();
            grounded = new Grounded();
            motion   = new Motion();
            cutscene = new Cutscene();

            // Add states
            StateMachine.AddState(StateName.Falling, falling);
            StateMachine.AddState(StateName.Grounded, grounded);
            StateMachine.AddState(StateName.Motion, motion);
            StateMachine.AddState(StateName.Cutscene, cutscene);
        }
示例#17
0
 internal void SetFalling(FallingObjectData mObjectData)
 {
     if (mObjectData == null || IsDisabled || Blocked)
     {
         return;
     }
     //  Debug.Log("set falling: " + mObjectData.ID);
     if (DynamicObject)
     {
         GameObject old = DynamicObject;
         DestroyImmediate(old);
     }
     if (StaticBlocker)
     {
         GameObject old = StaticBlocker.gameObject;
         DestroyImmediate(old);
     }
     FallingObject.Create(this, mObjectData, false, true, MBoard.TargetCollectEventHandler);//.gameObject;
     Falling.SetToFront(false);
 }
示例#18
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (CurrentAnimation == null)
            {
                CurrentAnimation = new Falling(this);
            }
            if (CurrentAnimation.Finished)
            {
                var animations = Assembly.GetExecutingAssembly().GetTypes().Where(t => string.Equals(t.Namespace, "scmpoo.animations.random"));
                var anim       = animations.ElementAt(FormMain.RandomInst.Next(0, animations.Count()));
                CurrentAnimation = Activator.CreateInstance(anim, this) as Animation;
            }
            if (!CurrentAnimation.Started)
            {
                CurrentAnimation.Start();
                CurrentAnimation.Started = true;
            }
            int interval = CurrentAnimation.Tick();

            timer1.Interval = interval;
        }
    // Use this for initialization
    void Start()
    {
        AudioObject.clip = StartRound;
        AudioObject.Play();
        Screen.SetResolution(1920, 1080, true);
        P1ScoreCoins = new GameObject[2];
        P2ScoreCoins = new GameObject[2];
        P1Score      = 0;
        P2Score      = 0;
        Customer     = GameObject.FindGameObjectWithTag("Customer");
        Customers    = Resources.LoadAll <Sprite>("Sprites/Customers");
        SetCoinArrays();
        Set();
        Goal = GameObject.FindGameObjectWithTag("FoodGoal").GetComponent <ChooseRandomFood>();
        fa   = GameObject.FindGameObjectWithTag("SpawnManager").GetComponent <Falling>();
        GameObject Player1 = GameObject.Find("Player1");
        GameObject Player2 = GameObject.Find("Player2");

        P1    = Player1.GetComponent <Player1Move>();
        P2    = Player2.GetComponent <Player2Move>();
        DFTP1 = Player1.GetComponent <DetectFoodType>();
        DFTP2 = Player2.GetComponent <DetectFoodType>();
    }
示例#20
0
 public bool HaveObjectWithID(int id)
 {
     if (Match && Match.GetID() == id)
     {
         return(true);
     }
     if (Falling && Falling.GetID() == id)
     {
         return(true);
     }
     if (Overlay && Overlay.GetID() == id)
     {
         return(true);
     }
     if (Underlay && Underlay.GetID() == id)
     {
         return(true);
     }
     if (DynamicClickBomb && DynamicClickBomb.GetID() == id)
     {
         return(true);
     }
     return(false);
 }
示例#21
0
 void ClearQueuedEvents()
 {
     Lava.Clear();
     Water.Clear();
     Falling.Clear();
 }
示例#22
0
 // Use this for initialization
 void Start()
 {
     falling = Smasher.GetComponent <Falling>();
 }
示例#23
0
 // Use this for initialization
 void Start()
 {
     m_fallingLogic = GetComponent <Falling>();
     assembled      = false;
 }
    // Update is called once per frame
    void Update()
    {
        if (_isAlive)
        {
            //input to change push strength
            if (Input.GetKeyDown(KeyCode.E))
            {
                currentPushStrength += 1;
                PushBar.SetStrength(currentPushStrength);
                Debug.Log("Increased Push strength to " + currentPushStrength);
            }
            if (Input.GetKeyDown(KeyCode.Q))
            {
                currentPushStrength -= 1;
                PushBar.SetStrength(currentPushStrength);
                Debug.Log("Decreased Push strength to " + currentPushStrength);
            }
            //keep push strength within restraints
            if (currentPushStrength > 3)
            {
                currentPushStrength = 3;
            }
            if (currentPushStrength < 1)
            {
                currentPushStrength = 1;
            }

            //get player input for movement
            float horizontal = Input.GetAxisRaw("Horizontal");
            float vertical   = Input.GetAxisRaw("Vertical");

            //create direction of movement based on player input
            Vector3 direction = new Vector3(horizontal, 0f, vertical).normalized;
            moveDirection = direction.magnitude;

            if (controller.isGrounded)
            {
                _isJumping = false;
            }

            //check to see if player is holding Left Shift to sprint, if player releases go back to normal run
            if (Input.GetKey(KeyCode.LeftShift))
            {
                _isSprinting = true;
            }
            else
            {
                _isSprinting = false;
            }
            if (Input.GetKeyDown(KeyCode.LeftShift) && direction.magnitude >= 0.1f)
            {
                CheckIfSprinting();
            }
            else if (Input.GetKeyUp(KeyCode.LeftShift) && direction.magnitude >= 0.1f)
            {
                StartRunning?.Invoke();
            }
            if (!_isSprinting && direction.magnitude >= 0.1)
            {
                CheckIfStartedMoving();
            }

            //if sprinting change the movement speed
            if (_isSprinting)
            {
                moveSpeed = sprintSpeed;
            }
            else
            {
                moveSpeed = speed;
            }

            if (controller.isGrounded)
            {
                velocityY = 0;
                //alow player to jump while grounded
                if (Input.GetButtonDown("Jump") && velocityY < 0.1f)
                {
                    velocityY = jumpSpeed;
                    StartJump?.Invoke();
                }
            }
            else if (!controller.isGrounded)
            {
                //apply gravity on player if they are not on the ground
                velocityY -= grav * Time.deltaTime;
                _isJumping = true;
            }

            if (direction.magnitude >= 0.1f)
            {
                if (!_isJumping)
                {
                    CheckIfStartedMoving();
                }


                //rotate player to face direction that they are moving in
                float targetAngle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg + cam.eulerAngles.y;
                //smooth rotation
                float angle = Mathf.SmoothDampAngle(transform.eulerAngles.y, targetAngle, ref turnSmoothVelocity, turnSmoothTime);
                transform.rotation = Quaternion.Euler(0f, angle, 0f);

                //move player in a direction if they are alive
                if (_isAlive)
                {
                    Vector3 moveDir = Quaternion.Euler(0f, targetAngle, 0f) * Vector3.forward;
                    controller.Move(moveDir.normalized * moveSpeed * Time.deltaTime);
                }
            }
            else
            {
                if (!_isJumping)
                {
                    CheckIfStoppedMoving();
                }
            }

            if (velocityY < -5f)
            {
                Falling?.Invoke();
            }

            //move in y direction if the player is alive
            if (_isAlive)
            {
                direction.y = velocityY;
                controller.Move(direction * Time.deltaTime);
            }
        }
    }
示例#25
0
 void SpawnBlock()
 {
     activeBlock = (Falling)Instantiate(blocks[Random.Range(0, blocks.Length)], new Vector3 (0, 15, 0), Quaternion.identity);
 }
示例#26
0
 public void FindRoofSpeed()
 {
     fall = FindObjectOfType <Falling>();
 }
示例#27
0
 public void PlayFalling()
 {
     Falling.Play();
 }
示例#28
0
 public void AddSFalling(Falling r)
 {
     fallingtList.Add(r);
 }
示例#29
0
 void Awake()
 {
     instance = this;
     //player = GameObject.FindGameObjectWithTag("Player");
 }
示例#30
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (CurrentBar < length)
            {
                return;
            }


            LRReversal.Set(LinReg(Close, Length)[0]);
            lRR.Set(LinReg(Close, Length)[0]);
            if (LRReversal[0] >= LRReversal[1])
            {
                lRR[0] = 1;
            }
            else
            {
                lRR[0] = -1;
            }


            bool rising  = false;
            bool falling = false;

            if (lRR[0] == 1)            //> lRR[1])
            {
                Rising.Set(lRR[0]);     //Rising.Set(1, lRR[1]);
                rising = true;

//					if (ColorBars)
//					{ CandleOutlineColor = BarColorOutline; BarColor = BarColorUp; }
            }
//				else
            if (lRR[0] == -1)                    //< lRR[1])
            {
                Falling.Set(lRR[0]);             //Falling.Set(1, lRR[1]);
                falling = true;

//					if (ColorBars)
//					{ CandleOutlineColor = BarColorOutline; BarColor = BarColorDown; }
            }

            //else
            if                     //((lRR[0] > lRR[1]) || (lRR[0] < lRR[1]))
            ((lRR[1] == 1 && lRR[0] == -1) || (lRR[1] == -1 && lRR[0] == 1))
            {
                Neutral.Set(lRR[0]);
                Neutral.Set(1, lRR[1]);
                rising = false; falling = false;

//					if (ColorBars)
//					{ CandleOutlineColor = BarColorOutline; BarColor = BarColorNeutral; }
            }



///////////////////////////////////////////////////////////////////////////////////////////////
            /// draw dot at second instance of +1 or -1
            ///////////////////////////////////////////////////////////////////////////////////
            if (drawDots)
            {
                if (LRR[2] == -1 &&
                    LRR[1] == 1 &&
                    LRR[0] == 1
                    )
                {
                    DrawDot("Dot" + CurrentBar, false, 0, 0, Color.Blue);
                    signal.Set(1);
                }
                else if (LRR[2] == 1 &&
                         LRR[1] == -1 &&
                         LRR[0] == -1
                         )
                {
                    DrawDot("Dot" + CurrentBar, false, 0, 0, Color.Red);
                    signal.Set(-1);
                }
                else
                {
                    RemoveDrawObject("Dot");
                }
            }

            if (signal[1] != 1 &&
                signal[0] == 1)
            {
                if (DrawLines)
                {
                    DrawVerticalLine("tag1l" + CurrentBar, 0, Color.Blue, DashStyle.DashDot, 3);
                    //DrawDot("tag1d"+CurrentBar,false,0,Low[0] - 8*TickSize,Color.Blue);
                }
            }
            if (signal[1] != -1 &&
                signal[0] == -1)
            {
                if (DrawLines)
                {
                    DrawVerticalLine("tag2l" + CurrentBar, 0, Color.Red, DashStyle.DashDot, 3);
                    //DrawDot("tag2d"+CurrentBar,false,0,High[0] + 8*TickSize,Color.Red);
                }
            }
        }
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (newbarsound)
            {
                if (FirstTickOfBar)
                {
                    PlaySound(newbarwavfilename);                                           // Added by TheWizard 02/06/10
                }
            }
            if (CurrentBar < 2)

            {
                PDM.Set(0);
                MDM.Set(0);
                PDI.Set(0);
                MDI.Set(0);
                Out.Set(0);
                Main.Set(0);
                Rising.Set(0);
                Falling.Set(0);
                Neutral.Set(0);
                return;
            }
            try
            {
                if (lastCalcBar != CurrentBar)
                {
                    lastCalcBar = CurrentBar;
//					setData( data, 0, 0d );
//					colorBar( 1 );
                    lastDirection = direction;
                }

                int i = 0;
                PDM.Set(0);
                MDM.Set(0);
                if (Close[i] > Close[i + 1])
                {
                    PDM.Set(Close[i] - Close[i + 1]);                  //This array is not displayed.
                }
                else
                {
                    MDM.Set(Close[i + 1] - Close[i]);                       //This array is not displayed.
                }
                PDM.Set(((WeightDM - 1) * PDM[i + 1] + PDM[i]) / WeightDM); //ema.
                MDM.Set(((WeightDM - 1) * MDM[i + 1] + MDM[i]) / WeightDM); //ema.

                double TR = PDM[i] + MDM[i];

                if (TR > 0)
                {
                    PDI.Set(PDM[i] / TR);
                    MDI.Set(MDM[i] / TR);
                }                //Avoid division by zero. Minimum step size is one unnormalized price pip.
                else
                {
                    PDI.Set(0);
                    MDI.Set(0);
                }

                PDI.Set(((WeightDI - 1) * PDI[i + 1] + PDI[i]) / WeightDI);        //ema.
                MDI.Set(((WeightDI - 1) * MDI[i + 1] + MDI[i]) / WeightDI);        //ema.

                double DI_Diff = PDI[i] - MDI[i];
                if (DI_Diff < 0)
                {
                    DI_Diff = -DI_Diff;                   //Only positive momentum signals are used.
                }
                double DI_Sum    = PDI[i] + MDI[i];
                double DI_Factor = 0;              //Zero case, DI_Diff will also be zero when DI_Sum is zero.
                if (DI_Sum > 0)
                {
                    Out.Set(DI_Diff / DI_Sum);                  //Factional, near zero when PDM==MDM (horizonal), near 1 for laddering.
                }
                else
                {
                    Out.Set(0);
                }

                Out.Set(((WeightDX - 1) * Out[i + 1] + Out[i]) / WeightDX);

                if (Out[i] > Out[i + 1])
                {
                    HHV = Out[i];
                    LLV = Out[i + 1];
                }
                else
                {
                    HHV = Out[i + 1];
                    LLV = Out[i];
                }

                for (int j = 1; j < Math.Min(ADXPeriod, CurrentBar); j++)
                {
                    if (Out[i + j + 1] > HHV)
                    {
                        HHV = Out[i + j + 1];
                    }
                    if (Out[i + j + 1] < LLV)
                    {
                        LLV = Out[i + j + 1];
                    }
                }


                double diff = HHV - LLV;    //Veriable reference scale, adapts to recent activity level, unnormalized.
                double VI   = 0;            //Zero case. This fixes the output at its historical level.
                if (diff > 0)
                {
                    VI = (Out[i] - LLV) / diff;              //Normalized, 0-1 scale.
                }
                //   if (VI_0.VIsq_1.VIsqroot_2==1)VI*=VI;
                //   if (VI_0.VIsq_1.VIsqroot_2==2)VI=MathSqrt(VI);
                //   if (VI>VImax)VI=VImax;//Used by Bemac with VImax=0.4, still used in vma1 and affects 5min trend definition.
                //All the ema weight settings, including Chande, affect 5 min trend definition.
                //   if (VI<=zeroVIbelow)VI=0;

                main.Set(((ChandeEMA - VI) * main[i + 1] + VI * Close[i]) / ChandeEMA);    //Chande VMA formula with ema built in.
                bool rising  = false;
                bool falling = false;

                if (conservativemode)
                {
                    if (main[0] > main[1])
                    {
                        Rising.Set(main[0]);
                        if (main[1] <= main[2] && Plots[0].PlotStyle == PlotStyle.Line)
                        {
                            Rising.Set(1, main[1]);
                        }
                        rising = true;
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorUp);            // added By TheWizard 02/06/10
                        }

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = Color.Transparent;
                                CandleOutlineColor = barColorUp;
                            }
                            else
                            {
                                BarColor = BarColorUp;
                            }
                        }
                    }
                    else if (main[0] < main[1])
                    {
                        Falling.Set(main[0]);
                        if (main[1] >= main[2] && Plots[1].PlotStyle == PlotStyle.Line)
                        {
                            Falling.Set(1, main[1]);
                        }
                        falling = true;

                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorDn);            // added By TheWizard 02/06/10
                        }

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = Color.Transparent;
                                CandleOutlineColor = barColorDown;
                            }
                            else
                            {
                                BarColor = BarColorDown;
                            }
                        }
                    }
                    else
                    {
                        Neutral.Set(main[0]); Neutral.Set(1, main[1]);
                        rising = false; falling = false;

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = BarColorNeutral;
                                CandleOutlineColor = BarColorOutline;
                            }
                            else
                            {
                                BarColor = BarColorNeutral;
                            }
                        }
                    }
                }

                if (!conservativemode)
                {
                    if (main[0] > main[1])
                    {
                        Rising.Set(main[0]); Rising.Set(1, main[1]);
                        rising = true;
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorUp);            // added By TheWizard 02/06/10
                        }

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = Color.Transparent;
                                CandleOutlineColor = barColorUp;
                            }
                            else
                            {
                                BarColor = BarColorUp;
                            }
                        }
                    }
                    else if (main[0] < main[1])
                    {
                        Falling.Set(main[0]); Falling.Set(1, main[1]);
                        falling = true;
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorDn);            // added By TheWizard 02/06/10
                        }

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = Color.Transparent;
                                CandleOutlineColor = barColorDown;
                            }
                            else
                            {
                                BarColor = BarColorDown;
                            }
                        }
                    }
                    else if (main[0] == main[0] && Median[0] > main[0])
                    {
                        Rising.Set(main[0]); Rising.Set(1, main[1]);
                        rising = true;
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorUp);            // added By TheWizard 02/06/10
                        }

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = Color.Transparent;
                                CandleOutlineColor = barColorUp;
                            }
                            else
                            {
                                BarColor = BarColorUp;
                            }
                        }
                    }
                    else if (main[0] == main[0] && Median[0] < main[0])
                    {
                        Falling.Set(main[0]); Falling.Set(1, main[1]);
                        falling = true;
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorDn);            // added By TheWizard 02/06/10
                        }

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = Color.Transparent;
                                CandleOutlineColor = barColorDown;
                            }
                            else
                            {
                                BarColor = BarColorDown;
                            }
                        }
                    }
                    else
                    {
                        Neutral.Set(main[0]); Neutral.Set(1, main[1]);
                        rising = false; falling = false;

                        if (ColorBars)
                        {
                            if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)              // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks
                            {
                                BarColor           = BarColorNeutral;
                                CandleOutlineColor = BarColorOutline;
                            }
                            else
                            {
                                BarColor = BarColorNeutral;
                            }
                        }
                    }
                }


                if (rising)
                {
                    Signal.Set(1);
                    if (colorbackground)
                    {
                        BackColor = Color.FromArgb(opacity, BackColorUp);                // added By TheWizard 02/06/10
                    }
                }
                else if (falling)
                {
                    Signal.Set(-1);
                    if (colorbackground)
                    {
                        BackColor = Color.FromArgb(opacity, BackColorDn);                // added By TheWizard 02/06/10
                    }
                }
                else
                {
                    Signal.Set(0);
                }
                if (Signal[0] == 0 && Signal[1] != 0)
                {
                    if (showDiamonds && CurrentBar >= 0)
                    {
                        double val1 = Neutral[i + 1] + (TickSize * DiamondDisplacement);
                        double val2 = Neutral[i + 1] - (TickSize * DiamondDisplacement);
                        DrawDiamond("topdiamond" + CurrentBar.ToString(), false, 1, val1, DiamondColor);
                        DrawDiamond("botdiamond" + CurrentBar.ToString(), false, 1, val2, DiamondColor);
                    }

                    if (diamondsoundon && FirstTickOfBar)
                    {
                        PlaySound(diamondalertwavfilename);
                    }
//					Print("Signal: " +Signal.ToString());
                }
                if (ShowArrows && CurrentBar >= 0)       //> 2)
                {
                    //if( lastDirection < direction )
                    if (Signal[0] == 1 && Signal[1] != 1)
                    {
                        double val = Low[i + 1] - (TickSize * ArrowDisplacement);
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorUp);            // added By TheWizard 02/06/10
                        }
                        if (FirstTickOfBar)
                        {
                            DrawArrowUp(CurrentBar.ToString(), 1, val, barColorUp);
                        }
                        //data[ data.Count - 1] = val  * -1;
                        //setData( data, bar, val  * -1 );
                        if (arrowsoundon && FirstTickOfBar)
                        {
                            PlaySound(longwavfilename);
                        }
                    }
                    //else if( lastDirection > direction )
                    else if (Signal[0] == -1 && Signal[1] != -1)
                    {
                        double val = High[i + 1] + (TickSize * ArrowDisplacement);
                        if (colorbackground)
                        {
                            BackColor = Color.FromArgb(opacity, BackColorDn);            // added By TheWizard 02/06/10
                        }
                        if (FirstTickOfBar)
                        {
                            DrawArrowDown(CurrentBar.ToString(), 1, val, barColorDown);
                        }
                        if (arrowsoundon && FirstTickOfBar)
                        {
                            PlaySound(shortwavfilename);
                        }
                        //setData( data, bar, val );
                    }
                }
//--Text Box Info--//

//			double ECOminus = Math.Abs(eco[1]-eco[0]);
//			double ECOplus = Math.Abs(eco[0]-eco[1]);

                if (textOnLeft)
                {
                    if (textOnTop)
                    {
                        tPosition = TextPosition.TopLeft;
                    }
                    else
                    {
                        bPosition = TextPosition.BottomLeft;
                    }
                }
                else
                {
                    if (!textOnTop)
                    {
                        bPosition = TextPosition.BottomRight;
                    }
                    else
                    {
                        tPosition = TextPosition.TopRight;
                    }
                }

                if (showText)
                {
                    if (Signal[0] == 1)
                    {
                        DrawTextFixed("Rising", " RISING ", tPosition, Color.White, textFontMed, Color.Black, Color.Blue, 10);
                    }
                    else
                    {
                        RemoveDrawObject("Rising");
                    }

                    if (Signal[0] == -1)
                    {
                        DrawTextFixed("Falling", " FALLING ", tPosition, Color.White, textFontMed, Color.Black, Color.Red, 10);
                    }
                    else
                    {
                        RemoveDrawObject("Falling");
                    }

                    if (Signal[0] == 0)
                    {
                        DrawTextFixed("Neutral", " NEUTRAL ", tPosition, Color.Black, textFontMed, Color.Black, Color.Goldenrod, 3);
                    }
                    else
                    {
                        RemoveDrawObject("Neutral");
                    }
                }
            }
            catch (Exception ex)
            {
                Print(ex.ToString());
            }
        }