示例#1
0
 public void Render()
 {
     foreach (var item in manager.Blocks)
     {
         drawer.Draw(item);
     }
     foreach (var item in manager.Fluids)
     {
         drawer.Draw(item);
     }
 }
示例#2
0
        public Bitmap CreateChart(IEnumerable <Function> functions)
        {
            var graphs = functions.Select(f =>
                                          new Graph(
                                              pointsGetter.GetPointsForOneFunction(f, -20, 20),
                                              f.Color,
                                              f.Name,
                                              f.Style,
                                              f.LeftBorder,
                                              f.RightBorder));
            var bitmap = graphDrawer.Draw(graphs);

            return(bitmap);
        }
示例#3
0
 private void DrawPlace_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (secondClick)
     {
         buf         = true;
         endPoint    = e.GetPosition(this);
         secondClick = false;
         IDrawer currentDrawer = DrawerDictionary[FiguresList.SelectedIndex].Creator();
         if (currentDrawer != null)
         {
             currShape.StartPoint = firstPoint;
             currShape.EndPoint   = endPoint;
             currShape.Type       = chosenType;
             currentDrawer.Draw(DrawPlace, currShape);
         }
     }
     if (firstClick)
     {
         firstClick  = false;
         firstPoint  = e.GetPosition(this);
         secondClick = true;
     }
     if (buf)
     {
         buf        = false;
         firstClick = true;
     }
 }
示例#4
0
 protected virtual void Draw(Rect region)
 {
     if (_contentDrawer != null)
     {
         _contentDrawer.Draw();
     }
 }
示例#5
0
 public void Draw()
 {
     foreach (var particle in _particles)
     {
         _drawer.Draw(particle.Boundings, particle.Color, particle.Rotation);
     }
 }
示例#6
0
 public void Draw()
 {
     if (_shouldDraw.Invoke())
     {
         _drawer.Draw();
     }
 }
示例#7
0
 public void Draw()
 {
     if (CurrentTime() <= _finishTime)
     {
         _drawer.Draw();
     }
 }
示例#8
0
 public void AddBlockTile(Block block, bool ShouldDraw)
 {
     Blocks.Add(block);
     if (ShouldDraw)
     {
         drawer.Draw(block);
     }
 }
示例#9
0
        public void Create()
        {
            var words        = wordReader.Read(config.InputFileName);
            var handledWords = textFilter.ExcludeWords(words);
            var rectangles   = tagMaker.Make(handledWords);

            drawer.Draw(rectangles);
        }
示例#10
0
        public void Save()
        {
            var words = compositor.Composite();
            var image = drawer.Draw(setting, words);

            image.Save($"{setting.Name}.{setting.Format}");
            image.Dispose();
        }
示例#11
0
        public void Draw()
        {
            foreach (var wall in _level.Walls)
            {
                _drawer.Draw(wall.Boundings, wall.Color, wall.Rotation);
            }

            foreach (var block in _level.Blocks)
            {
                _drawer.Draw(block.Boundings, block.Color, block.Rotation);
            }

            _drawer.Draw(_level.Paddle.Boundings, _level.Paddle.Color, _level.Paddle.Rotation);
            _drawer.Draw(_level.Ball.Boundings, _level.Ball.Color, _level.Ball.Rotation);

            _particleManager.Draw();
        }
示例#12
0
        public void Draw()
        {
            GUI.depth += _delta;

            _drawer.Draw();

            GUI.depth -= _delta;
        }
示例#13
0
        protected override void Draw(Rect region)
        {
            base.Draw(region);

            if (_footer != null)
            {
                _footer.Draw();
            }
        }
示例#14
0
        public IActionResult Draw(int id)
        {
            var deck  = _game.Board.Decks.FirstOrDefault(d => d.Id == id);
            var cards = deck.Cards;

            var drawedCard = _drawer.Draw(ref cards);

            return(Ok(_deckMapper.Map(deck)));
        }
示例#15
0
        public void Draw()
        {
            _drawer.Draw();

            if (Event.current.type == EventType.MouseUp && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
            {
                _OnClick.InvokeSafe();
            }
        }
示例#16
0
        public void ShouldDrawCardFromInitDeck()
        {
            var cardsFromInitDeck = _board.Decks[0].Cards;
            var drawedCard        = _drawer.Draw(ref cardsFromInitDeck);

            Assert.AreEqual(Rank.Ace, drawedCard.Rank);
            Assert.AreEqual(Color.Heart, drawedCard.Color);
            Assert.AreEqual(true, drawedCard.IsShown);
        }
示例#17
0
 private void DoRight(Rect rect)
 {
     if (selected is LevelingAction selectedAction)
     {
         DoActionContent(rect, ref selectedAction);
     }
     else
     {
         selected.Draw(rect);
     }
 }
示例#18
0
 public void Draw()
 {
     if (_listDrawer.Count() == 0 && _emptyDrawer != null)
     {
         _emptyDrawer.Draw();
     }
     else
     {
         _listDrawer.Draw();
     }
 }
 public void Draw()
 {
     if (_sequenceDrawer.Count() > 0)
     {
         _sequenceDrawer.Draw();
     }
     else if (_emptyDrawer != null)
     {
         _emptyDrawer.Draw();
     }
 }
示例#20
0
        public void Tick(IDrawer drawer)
        {
            //ball
            _ball.Location += _ball.Direction;

            if (_ball.Location.X <= 0 || _ball.Location.X >= Width)
            {
                _ball.Direction = new Vector2(-_ball.Direction.X, _ball.Direction.Y);
            }

            if (_ball.Location.Y <= 0 || _ball.Location.Y >= Height)
            {
                _ball.Direction = new Vector2(_ball.Direction.X, -_ball.Direction.Y);
            }

            drawer.Draw(_ball);
            foreach (var player in _players)
            {
                drawer.Draw(player);
            }
        }
 private void drawIDrawableUILayout(DrawableUILayout drawable, float delta, IDrawer drawer)
 {
     drawer.Draw(
         drawable.Drawable,
         drawable.Area,
         drawable.Tint,
         delta,
         drawable.Origin,
         0,
         drawable.SourceRectangle
     );
 }
示例#22
0
        public void DrawShape(IShape shape)
        {
            IDrawer drawer = drawers.FirstOrDefault(s => s.IsMatch(shape));

            if (drawer == null)
            {
                Console.WriteLine($"There is no shape \"{shape.GetType().Name}\"");
            }
            else
            {
                drawer.Draw();
            }
        }
示例#23
0
        public void Draw()
        {
            if (!_focus)
            {
                _drawerToFocus.Draw();
                return;
            }

            _focus = false;

            GUI.SetNextControlName(_controlName);
            _drawerToFocus.Draw();

            if (_drawerToFocus is ITextField)
            {
                EditorGUI.FocusTextInControl(_controlName);
            }
            else
            {
                GUI.FocusControl(_controlName);
            }
        }
示例#24
0
 private void OnGUI()
 {
     if (drawer == null)
     {
         var so = new UnityEditor.SerializedObject(Resources.Load("EnvironmentBuilder"));
         drawer = new EnvironmentSettingsDrawer();
         drawer.SetUp(so);
     }
     else
     {
         drawer.Draw();
     }
 }
        private void drawIAnimatableUILayout(AnimatableUILayout animatable, float delta, IDrawer drawer)
        {
            animatable.Animatable.PreDraw(delta);

            drawer.Draw(
                animatable.Animatable,
                animatable.Area,
                animatable.Tint,
                delta,
                null,
                0,
                animatable.Animatable.GetSourceRectangle()
            );
        }
示例#26
0
        public void Draw()
        {
            GUI.SetNextControlName(_uniqueControlName);

            _drawer.Draw();

            if (GUI.GetNameOfFocusedControl().Equals(_uniqueControlName))
            {
                if (Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.Return)
                {
                    EditorApplication.delayCall += () => ReturnPressed.InvokeSafe();
                }
            }
        }
示例#27
0
 public bool Draw(object data, StateGraph context)
 {
     if (Drawer == null || ValidMethod != null && !(bool)ValidMethod.Invoke(data, null))
     {
         return(false);
     }
     if (Drawer.Draw(Content, Info.GetValue(data), context))
     {
         DrawerCollector.OnPropertyModify(context);
         Info.SetValue(data, Drawer.GetValue());
         return(true);
     }
     return(false);
 }
示例#28
0
        public void DrawText(string text, Vector2 position, int size,
                             Color color)
        {
            var basePosition = position;

            foreach (var number in text.ToArray())
            {
                var positionMap = GetPixelPlot(number.ToString(CultureInfo.InvariantCulture));
                foreach (var pixelPosition in positionMap.Pixels)
                {
                    _drawer.Draw(basePosition + pixelPosition * size, color);
                }

                basePosition += new Vector2(Width, 0) * size;
            }
        }
示例#29
0
        private bool Draw(object val, StateGraph context, bool offset)
        {
            bool modify = false;

            if (BaseTypeDrawer != null)
            {
                modify = modify || BaseTypeDrawer.Draw(null, val, context);
            }
            using (new GUILayout.VerticalScope(offset ? ClassTypeDrawer.ContentStyle : ClassTypeDrawer.Empty))
            {
                foreach (var field in Fields)
                {
                    modify = modify || field.Draw(val, context);
                }
            }
            value = val;
            return(modify);
        }
示例#30
0
        void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
        {
            SKImageInfo info    = args.Info;
            SKSurface   surface = args.Surface;
            SKCanvas    canvas  = surface.Canvas;

            canvas.Clear();

            SKPaint paint = new SKPaint
            {
                Style       = SKPaintStyle.Stroke,
                Color       = Color.Red.ToSKColor(),
                StrokeWidth = 10
            };

            if (drawer != null)
            {
                drawer.Draw(canvas, paint, info.Width / 2, info.Height / 2);
            }
        }
示例#31
0
 private bool Draw(object val, StateGraph context, bool offset)
 {
     if (val == null)
     {
         DrawerCollector.OnPropertyModify(context);
         return(true);
     }
     if (BaseTypeDrawer != null)
     {
         BaseTypeDrawer.Draw(null, val, context);
     }
     if (ValidMethod == null || (bool)ValidMethod.Invoke(val, null))
     {
         using (new GUILayout.VerticalScope(offset ? ContentStyle : Empty))
         {
             foreach (var field in Fields)
             {
                 field.Draw(val, context);
             }
         }
     }
     return(false);
 }