OpenMoHAA ..
Loading...
Searching...
No Matches
consoleevent.h
1/*
2===========================================================================
3Copyright (C) 2025 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25#include "../corepp/listener.h"
26#include "../corepp/mem_blockalloc.h"
27#include "g_public.h"
28
29class ConsoleEvent : public Event
30{
31private:
32 gentity_t *m_consoleedict;
33
34public:
35 CLASS_PROTOTYPE(ConsoleEvent);
36
37 void *operator new(size_t size);
38 void operator delete(void *ptr);
39
40 ConsoleEvent();
41
42 ConsoleEvent(str name)
43 : Event(name)
44 {
45 m_consoleedict = NULL;
46 }
47
48 void SetConsoleEdict(gentity_t *edict);
49 gentity_t *GetConsoleEdict(void) const;
50
51 void ErrorInternal(Listener *l, str text) const override;
52};
53
54extern MEM_BlockAlloc<ConsoleEvent> ConsoleEvent_allocator;