Compare commits
3 Commits
main
...
NetChannel
| Author | SHA1 | Date | |
|---|---|---|---|
| 21a6a6ddda | |||
| eb3ab732c6 | |||
| d60d4c27ab |
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.30.4)
|
||||
cmake_minimum_required(VERSION 3.25.1)
|
||||
|
||||
set(IS_OS_WINDOWS FALSE)
|
||||
set(IS_OS_LINUX FALSE)
|
||||
|
||||
@@ -105,13 +105,13 @@ int main()
|
||||
|
||||
if (!response.IsNum())
|
||||
{
|
||||
ehs::Console::Clear(); // Clear the console's buffer.
|
||||
return main(); // Repeat process if given response is not a number.
|
||||
ehs::Console::Clear(); // Clear the console's buffer.
|
||||
return main(); // Repeat process if given response is not a number.
|
||||
}
|
||||
|
||||
ehs::UInt_8 age = response.ToDecimal<ehs::UInt_8>(); // Converts the string number into a number based primitive.
|
||||
|
||||
ehs::Console::Write("Your age is " + ehs::Str_8::FromNum(age) + "."); // Write the console with the age converted back to string.
|
||||
ehs::Console::Write_8("Your age is " + ehs::Str_8::FromNum(age) + "."); // Write the console with the age converted back to string.
|
||||
|
||||
ehs::Uninitialize();
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace ehs
|
||||
{
|
||||
private:
|
||||
Array<InputHandler*> handlers;
|
||||
bool initalized;
|
||||
bool initialized;
|
||||
|
||||
public:
|
||||
~Input();
|
||||
@@ -31,13 +31,13 @@ namespace ehs
|
||||
|
||||
void Poll();
|
||||
|
||||
bool HasHandler(const UInt_64 hashId) const;
|
||||
bool HasHandler(UInt_64 hashId) const;
|
||||
|
||||
bool HasHandler(const Str_8& id) const;
|
||||
|
||||
bool AddHandler(InputHandler* handler);
|
||||
|
||||
const InputHandler* GetHandler(const UInt_64 hashId) const;
|
||||
const InputHandler* GetHandler(UInt_64 hashId) const;
|
||||
|
||||
const InputHandler* GetHandler(const Str_8& id) const;
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace ehs
|
||||
|
||||
InputHandler& operator=(const InputHandler& ih);
|
||||
|
||||
bool operator==(const UInt_64 otherHashId) const;
|
||||
bool operator==(UInt_64 otherHashId) const;
|
||||
|
||||
bool operator!=(const UInt_64 otherHashId) const;
|
||||
bool operator!=(UInt_64 otherHashId) const;
|
||||
|
||||
virtual bool Initialize();
|
||||
|
||||
@@ -47,13 +47,13 @@ namespace ehs
|
||||
|
||||
void ResetAllStates();
|
||||
|
||||
bool HasDevice(const UInt_64 id) const;
|
||||
bool HasDevice(UInt_64 id) const;
|
||||
|
||||
bool AddDevice(HID* device);
|
||||
|
||||
HID* GetDevice(const UInt_64 id) const;
|
||||
HID* GetDevice(UInt_64 id) const;
|
||||
|
||||
HID* GetDeviceByType(const UInt_8 type) const;
|
||||
HID* GetDeviceByType(UInt_8 type) const;
|
||||
|
||||
virtual bool IsInitialized() const;
|
||||
};
|
||||
|
||||
@@ -9,18 +9,18 @@ namespace ehs
|
||||
}
|
||||
|
||||
Input::Input()
|
||||
: initalized(false)
|
||||
: initialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
Input::Input(Input&& input) noexcept
|
||||
: handlers((Array<InputHandler*>&&)input.handlers), initalized(input.initalized)
|
||||
: handlers((Array<InputHandler*>&&)input.handlers), initialized(input.initialized)
|
||||
{
|
||||
input.initalized = false;
|
||||
input.initialized = false;
|
||||
}
|
||||
|
||||
Input::Input(const Input& input)
|
||||
: initalized(false)
|
||||
: initialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ namespace ehs
|
||||
return *this;
|
||||
|
||||
handlers = (Array<InputHandler*>&&)input.handlers;
|
||||
initalized = input.initalized;
|
||||
initialized = input.initialized;
|
||||
|
||||
input.initalized = false;
|
||||
input.initialized = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -46,14 +46,14 @@ namespace ehs
|
||||
delete handlers;
|
||||
|
||||
handlers = Array<InputHandler*>();
|
||||
initalized = false;
|
||||
initialized = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Input::Initialize()
|
||||
{
|
||||
if (initalized)
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
UInt_64 i = 0;
|
||||
@@ -72,12 +72,12 @@ namespace ehs
|
||||
i++;
|
||||
}
|
||||
|
||||
initalized = true;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
void Input::Release()
|
||||
{
|
||||
if (!initalized)
|
||||
if (!initialized)
|
||||
return;
|
||||
|
||||
UInt_64 i = 0;
|
||||
@@ -96,7 +96,7 @@ namespace ehs
|
||||
i++;
|
||||
}
|
||||
|
||||
initalized = false;
|
||||
initialized = false;
|
||||
}
|
||||
|
||||
void Input::Poll()
|
||||
@@ -124,7 +124,7 @@ namespace ehs
|
||||
if (HasHandler(handler->GetHashId()))
|
||||
return false;
|
||||
|
||||
if (initalized)
|
||||
if (initialized)
|
||||
{
|
||||
bool hInitialized = handler->Initialize();
|
||||
if (!hInitialized)
|
||||
@@ -155,6 +155,6 @@ namespace ehs
|
||||
|
||||
bool Input::IsInitialized() const
|
||||
{
|
||||
return initalized;
|
||||
return initialized;
|
||||
}
|
||||
}
|
||||
@@ -415,7 +415,7 @@ namespace ehs
|
||||
return hdl != EHS_INVALID_SOCKET;
|
||||
}
|
||||
|
||||
void TCP::Bind_v6(const Str_8& address, UInt_16 port)
|
||||
void TCP::Bind_v6(const Str_8 &address, const UInt_16 &port)
|
||||
{
|
||||
sockaddr_in6 result = {};
|
||||
result.sin6_family = AF_INET6;
|
||||
@@ -451,7 +451,7 @@ namespace ehs
|
||||
}
|
||||
}
|
||||
|
||||
void TCP::Bind_v4(const Str_8& address, UInt_16 port)
|
||||
void TCP::Bind_v4(const Str_8 &address, const UInt_16 &port)
|
||||
{
|
||||
sockaddr_in result = {};
|
||||
result.sin_family = AF_INET;
|
||||
|
||||
Reference in New Issue
Block a user