コード例 #1
0
ファイル: Mirror.cs プロジェクト: ibukisaar/TheMagicCircle
        private Drawing GetDrawing()
        {
            var md = new MirrorDrawing(CellSize);

            switch (Cell)
            {
            case LightSource lightSource: return(md.GetLightSource(lightSource.Color));

            case Reflection _: return(md.GetReflection());

            case BeveledReflection _: return(md.GetBeveledReflection());

            case Discolor _: return(md.GetDiscolor());

            case Splitting _: return(md.GetSplitting());

            case Quantum _: return(md.GetQuantum());

            case TargetLight targetLight: return(md.GetTargetLight(targetLight));

            case BlackLight blackLight: return(md.GetBlackLight(blackLight));

            case Prism _: return(md.GetPrism());

            case Xor _: return(md.GetXor());

            case And _: return(md.GetAnd());

            case Or _: return(md.GetOr());

            case Filter filter: return(md.GetFilter(filter.Color));

            case OneWay _: return(md.GetOneWay());

            case TwoWay _: return(md.GetTwoWay());

            case Obstacle _: return(md.GetObstacle());

            case Blockade _: return(md.GetBlockade());

            case Wormhole wormhole: return(md.GetWormhole(wormhole.Color));

            case ColorSplitting colorSplitting: return(md.GetColorSplitting(colorSplitting.Color));

            default: return(null);
            }
        }
コード例 #2
0
ファイル: Mirror.cs プロジェクト: ibukisaar/TheMagicCircle
 private void Target_ActivatedChanged(TargetCell obj)
 {
     if (obj.Activated)
     {
         Effect = new System.Windows.Media.Effects.DropShadowEffect()
         {
             BlurRadius = CellSize,
             Color      = obj is IColor colorObj?MirrorDrawing.GetColor(colorObj.Color) : Colors.Black,
                              ShadowDepth   = 0,
                              Opacity       = 1,
                              RenderingBias = System.Windows.Media.Effects.RenderingBias.Quality,
         };
     }
     else
     {
         ClearValue(EffectProperty);
     }
 }