| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file platform_interface.h |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par Licence: |
| 9 | * Copyright (c) 2015-2026 Carsten Teibes |
| 10 | * |
| 11 | * OpenJazz is distributed under the terms of |
| 12 | * the GNU General Public License, version 2.0 |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | |
| 17 | #ifndef _PLATFORM_INTERFACE_H |
| 18 | #define _PLATFORM_INTERFACE_H |
| 19 | |
| 20 | class IPlatform { |
| 21 | public: |
| 22 | virtual ~IPlatform() =0; |
| 23 | |
| 24 | static IPlatform* make(); |
| 25 | |
| 26 | virtual void NetInit(); |
| 27 | virtual void NetExit(); |
| 28 | virtual bool NetHasConsole(); |
| 29 | |
| 30 | virtual bool WantsExit(); |
| 31 | |
| 32 | virtual void AddGamePaths(); |
| 33 | virtual void ErrorNoDatafiles(); |
| 34 | |
| 35 | virtual bool InputIP(char*& current_ip, char*& new_ip); |
| 36 | virtual bool InputString(const char* hint, char*& current_string, char*& new_string); |
| 37 | protected: |
| 38 | IPlatform() {}; |
| 39 | }; |
| 40 | |
| 41 | // stubs |
| 42 | |
| 43 | inline void IPlatform::NetInit() { } |
| 44 | inline void IPlatform::NetExit() { } |
| 45 | inline bool IPlatform::NetHasConsole() { return false; } |
| 46 | |
| 47 | inline bool IPlatform::WantsExit() { return false; } |
| 48 | |
| 49 | inline bool IPlatform::InputIP(char*&, char*&) { |
| 50 | return false; |
| 51 | } |
| 52 | inline bool IPlatform::InputString(const char*, char*&, char*&) { |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | #endif |