Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
mtevent.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "irrlichttypes.h"
8
28
29// An event with no parameters and customizable name
31{
33
34public:
36 Type getType() const override { return type; }
37};
38
40{
41public:
42 virtual ~MtEventReceiver() = default;
43 virtual void onEvent(MtEvent *e) = 0;
44};
45
46typedef void (*event_receive_func)(MtEvent *e, void *data);
47
49{
50public:
51 virtual ~MtEventManager() = default;
52 virtual void put(MtEvent *e) = 0;
53 virtual void reg(MtEvent::Type type, event_receive_func f, void *data) = 0;
54 // If data==NULL, every occurrence of f is deregistered.
55 virtual void dereg(MtEvent::Type type, event_receive_func f, void *data) = 0;
56};
Definition mtevent.h:49
virtual void put(MtEvent *e)=0
virtual ~MtEventManager()=default
virtual void reg(MtEvent::Type type, event_receive_func f, void *data)=0
virtual void dereg(MtEvent::Type type, event_receive_func f, void *data)=0
Definition mtevent.h:40
virtual ~MtEventReceiver()=default
virtual void onEvent(MtEvent *e)=0
Definition mtevent.h:10
Type
Definition mtevent.h:13
@ PLAYER_JUMP
Definition mtevent.h:20
@ PLAYER_DAMAGE
Definition mtevent.h:18
@ PLAYER_FALLING_DAMAGE
Definition mtevent.h:17
@ VIEW_BOBBING_STEP
Definition mtevent.h:14
@ NODE_DUG
Definition mtevent.h:19
@ TYPE_MAX
Definition mtevent.h:22
@ PLAYER_REGAIN_GROUND
Definition mtevent.h:21
@ CAMERA_PUNCH_LEFT
Definition mtevent.h:15
@ CAMERA_PUNCH_RIGHT
Definition mtevent.h:16
virtual ~MtEvent()=default
virtual Type getType() const =0
Definition mtevent.h:31
Type getType() const override
Definition mtevent.h:36
Type type
Definition mtevent.h:32
SimpleTriggerEvent(Type type)
Definition mtevent.h:35
void(* event_receive_func)(MtEvent *e, void *data)
Definition mtevent.h:46