Beispiel #1
0
        public void Draw()
        {
            PreDrawEvent?.Invoke(this, EventArgs.Empty);
            Console.WriteLine("Drawing a shape");

            PostDrawnEvent?.Invoke(this, EventArgs.Empty);
        }
Beispiel #2
0
        // For the sake of simplicity this one method
        // implements both interfaces.
        public void Draw()
        {
            // Raise IDrawingObject's event before the object is drawn.
            PreDrawEvent?.Invoke(this, EventArgs.Empty);

            Console.WriteLine("Drawing a shape.");

            // Raise IShape's event after the object is drawn.
            PostDrawEvent?.Invoke(this, EventArgs.Empty);
        }
Beispiel #3
0
 public void Draw()
 {
     PreDrawEvent?.Invoke(this, new EventArgs());
     Console.WriteLine("Drawing a shape.");
     PostDrawEvent?.Invoke(this, new EventArgs());
 }
 public void PreDraw(Player player, SpriteBatch spriteBatch)
 {
     PreDrawEvent?.Invoke(player, Main.spriteBatch);
 }