Ejemplo n.º 1
0
 public void Render()
 {
     foreach (var item in manager.Blocks)
     {
         drawer.Draw(item);
     }
     foreach (var item in manager.Fluids)
     {
         drawer.Draw(item);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 4
0
 protected virtual void Draw(Rect region)
 {
     if (_contentDrawer != null)
     {
         _contentDrawer.Draw();
     }
 }
Ejemplo n.º 5
0
 public void Draw()
 {
     foreach (var particle in _particles)
     {
         _drawer.Draw(particle.Boundings, particle.Color, particle.Rotation);
     }
 }
Ejemplo n.º 6
0
 public void Draw()
 {
     if (_shouldDraw.Invoke())
     {
         _drawer.Draw();
     }
 }
Ejemplo n.º 7
0
 public void Draw()
 {
     if (CurrentTime() <= _finishTime)
     {
         _drawer.Draw();
     }
 }
Ejemplo n.º 8
0
 public void AddBlockTile(Block block, bool ShouldDraw)
 {
     Blocks.Add(block);
     if (ShouldDraw)
     {
         drawer.Draw(block);
     }
 }
Ejemplo n.º 9
0
        public void Create()
        {
            var words        = wordReader.Read(config.InputFileName);
            var handledWords = textFilter.ExcludeWords(words);
            var rectangles   = tagMaker.Make(handledWords);

            drawer.Draw(rectangles);
        }
Ejemplo n.º 10
0
        public void Save()
        {
            var words = compositor.Composite();
            var image = drawer.Draw(setting, words);

            image.Save($"{setting.Name}.{setting.Format}");
            image.Dispose();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 12
0
        public void Draw()
        {
            GUI.depth += _delta;

            _drawer.Draw();

            GUI.depth -= _delta;
        }
Ejemplo n.º 13
0
        protected override void Draw(Rect region)
        {
            base.Draw(region);

            if (_footer != null)
            {
                _footer.Draw();
            }
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 15
0
        public void Draw()
        {
            _drawer.Draw();

            if (Event.current.type == EventType.MouseUp && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
            {
                _OnClick.InvokeSafe();
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 17
0
 private void DoRight(Rect rect)
 {
     if (selected is LevelingAction selectedAction)
     {
         DoActionContent(rect, ref selectedAction);
     }
     else
     {
         selected.Draw(rect);
     }
 }
Ejemplo n.º 18
0
 public void Draw()
 {
     if (_listDrawer.Count() == 0 && _emptyDrawer != null)
     {
         _emptyDrawer.Draw();
     }
     else
     {
         _listDrawer.Draw();
     }
 }
Ejemplo n.º 19
0
 public void Draw()
 {
     if (_sequenceDrawer.Count() > 0)
     {
         _sequenceDrawer.Draw();
     }
     else if (_emptyDrawer != null)
     {
         _emptyDrawer.Draw();
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 21
0
 private void drawIDrawableUILayout(DrawableUILayout drawable, float delta, IDrawer drawer)
 {
     drawer.Draw(
         drawable.Drawable,
         drawable.Area,
         drawable.Tint,
         delta,
         drawable.Origin,
         0,
         drawable.SourceRectangle
     );
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 25
0
        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()
            );
        }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
 }