Unite() public method

public Unite ( Qyoto.QRect r ) : QRegion
r Qyoto.QRect
return QRegion
コード例 #1
0
ファイル: cannonfield.cs プロジェクト: KDE/qyoto
    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);
    }
コード例 #2
0
ファイル: cannonfield.cs プロジェクト: KDE/qyoto
    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);
    }