Unite() public method

public Unite ( Qyoto.QRect r ) : QRegion
r Qyoto.QRect
return QRegion
Esempio n. 1
0
    private void moveShot()
    {
        QRegion region = new QRegion(shotRect());
        timerCount++;

        QRect shotR = shotRect();

        if (shotR.Intersects(targetRect())) {
            autoShootTimer.Stop();
            Emit.hit();
        } else if (shotR.X() > Width() || shotR.Y() > Height()) {
            autoShootTimer.Stop();
            Emit.missed();
        } else {
            region = region.Unite(new QRegion(shotR));
        }

        Update(region);
    }
Esempio n. 2
0
    private void MoveShot()
    {
        QRegion region = new QRegion(ShotRect());
        timerCount++;

        QRect shotR = ShotRect();

        if (shotR.Intersects(TargetRect())) {
            autoShootTimer.Stop();
            Emit.Hit();
            Emit.CanShoot(true);
        } else if (shotR.X() > Width() || shotR.Y() > Height()
                   || shotR.Intersects(BarrierRect())) {
            autoShootTimer.Stop();
            Emit.Missed();
            Emit.CanShoot(true);
        } else {
            region = region.Unite(shotR);
        }

        Update(region);
    }