Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            // Create event manager
            var player = new MyPlayer();

            // Register callback on event: "Move"
            // If you want to pass data, define your event class (see example event)
            player.On("Move", (e) => {
                // Cast event argrument to your event object
                var obj = (PlayerEvent) e;

                // Get (set) your event object data
                if (obj.player.x == 42 && obj.player.y == 42) {
                    // Player is in the perfect spot :)
                }

                // Other code
            });
        }
Ejemplo n.º 2
0
 public PlayerEvent(MyPlayer player)
 {
     this.player = player;
 }
Ejemplo n.º 3
0
 public PlayerEvent(MyPlayer player)
 {
     this.player = player;
 }