Browse Source

Add accessors to generic Core API to Acedia's objects and actors

core_refactor
Anton Tarasenko 2 years ago
parent
commit
bdaccd4586
  1. 23
      sources/Types/AcediaActor.uc
  2. 23
      sources/Types/AcediaObject.uc

23
sources/Types/AcediaActor.uc

@ -3,7 +3,7 @@
* `AcediaActor` provides access to Acedia's APIs through an accessor to
* a `Global` object, built-in mechanism for storing unneeded references in
* an object pool and constructor/finalizer.
* Copyright 2021 Anton Tarasenko
* Copyright 2021-2023 Anton Tarasenko
*------------------------------------------------------------------------------
* This file is part of Acedia.
*
@ -416,6 +416,27 @@ public simulated static final function Global __()
return class'Global'.static.GetInstance();
}
/**
* Static method accessor to the generic core API namespace (either server or
* client one, depending on which is available), necessary for Acedia's
* implementation.
*/
public static final function CoreGlobal __core()
{
local ServerGlobal serverAPI;
local ClientGlobal clientAPI;
serverAPI = class'ServerGlobal'.static.GetInstance();
if (serverAPI != none && serverAPI.IsAvailable()) {
return serverAPI;
}
clientAPI = class'ClientGlobal'.static.GetInstance();
if (clientAPI != none && clientAPI.IsAvailable()) {
return clientAPI;
}
return none;
}
/**
* Static method accessor to server API namespace, necessary for Acedia's
* implementation.

23
sources/Types/AcediaObject.uc

@ -3,7 +3,7 @@
* `AcediaObject` provides access to Acedia's APIs through an accessor to
* a `Global` object, built-in mechanism for storing unneeded references in
* an object pool and constructor/finalizer.
* Copyright 2021 Anton Tarasenko
* Copyright 2021-2023 Anton Tarasenko
*------------------------------------------------------------------------------
* This file is part of Acedia.
*
@ -489,6 +489,27 @@ public static final function Global __()
return class'Global'.static.GetInstance();
}
/**
* Static method accessor to the generic core API namespace (either server or
* client one, depending on which is available), necessary for Acedia's
* implementation.
*/
public static final function CoreGlobal __core()
{
local ServerGlobal serverAPI;
local ClientGlobal clientAPI;
serverAPI = class'ServerGlobal'.static.GetInstance();
if (serverAPI != none && serverAPI.IsAvailable()) {
return serverAPI;
}
clientAPI = class'ClientGlobal'.static.GetInstance();
if (clientAPI != none && clientAPI.IsAvailable()) {
return clientAPI;
}
return none;
}
/**
* Static method accessor to server API namespace, necessary for Acedia's
* implementation.

Loading…
Cancel
Save