コード例 #1
0
        public bool CollidesWith(ObstacleStub other)
        {
            if (ObstacleType == ObstacleStubType.BlackHole || ObstacleType == ObstacleStubType.WhiteHole)
            {
                if (this.Position == other.Position && (other.ObstacleType == ObstacleStubType.BlackHole || other.ObstacleType == ObstacleStubType.WhiteHole))
                {
                    return(true);
                }
                return(false);
            }
            if (other.ObstacleType == ObstacleStubType.BlackHole || other.ObstacleType == ObstacleStubType.WhiteHole)
            {
                return(false);
            }

            if (this.ObstacleType == ObstacleStubType.VoidVircle && other.ObstacleType == ObstacleStubType.VoidVircle && this.Position != other.Position)
            {
                return(false);
            }
            if (this.ObstacleType == ObstacleStubType.MirrorBlock && other.ObstacleType == ObstacleStubType.MirrorBlock && this.Position != other.Position)
            {
                return(false);
            }

            var g1 = this.GetArea();
            var g2 = other.GetArea();

            return(g1.Overlaps(g2));
        }
コード例 #2
0
ファイル: PortalStub.cs プロジェクト: sorke/GridDominance
        public bool CollidesWith(ObstacleStub other)
        {
            switch (other.ObstacleType)
            {
            case ObstacleStub.ObstacleStubType.BlackHole:
            case ObstacleStub.ObstacleStubType.WhiteHole:
                return(false);

            case ObstacleStub.ObstacleStubType.GlassBlock:
            case ObstacleStub.ObstacleStubType.MirrorBlock:
            case ObstacleStub.ObstacleStubType.MirrorCircle:
                return(this.GetArea().Overlaps(other.GetArea()));

            case ObstacleStub.ObstacleStubType.VoidVircle:
                return(false);

            default:
                SAMLog.Error("LEPS::EnumSwitch_CW_OS", "other.ObstacleType = " + other.ObstacleType);
                return(true);
            }
        }
コード例 #3
0
 public bool CollidesWith(ObstacleStub other)
 {
     return(other.CollidesWith(this));
 }
コード例 #4
0
ファイル: WallStub.cs プロジェクト: sorke/GridDominance
 public bool CollidesWith(ObstacleStub other)
 {
     return(false);
 }