EthanBoiDev

Relight Engine Documentation

CoreFramework.Core

The absolute core, contains very common functionality

Classes

Class AsyncEvent

void Start()

Constantly monitors the completion status of a future object until it is complete.


void Restart()

Resets all values to default


void ChangeToComplete()

Set the promise object to true


bool isReady()

Returns whether the future is complete or not


Class Boxed

Boxed(T Value)

A Constructor that set's a value


class BuzHash

BuzHash()

A Constructor that set's the current to 0


BuzHash(int i)

A Constructor that set's the current to value i


void Reset()

Reset the current back to 0


unsigned int GetCurrent()

returns the current


unsigned int Add(unsigned int cur, uint8_t var)

returns the updated hash to spacific byte variable


void Add(uint8_t var)

Set the current to itself + var


void Sub(uint8_t var, int t)

modifies the current via removing 1 byte from the hash window


unsigned int Sub(unsigned int Current, uint8_t var, int t)

returns the inputted current with modifications via removing 1 byte from teh hash window


static unsigned int Threshold(int size)

Returns (1L << 32) / size;


class Task

Task(function func)

A constructor that set's the function


void start()

If not running, it will create a future


void wait()

If running, will wait the future state to be ready, and turn running off


void wait(int milisecs)

If running, will wait for milisecs for the future state to be ready, and turn running off


void delay(int milisecs)

Will delay the future function for milisecs


Task ConfigureAwait(bool continueOn)

set continueOnCapturedContext to continueOn and returns itself


T get()

Returns the future's result


bool isCompleted()

Returns if the future is ready


Class CancellationToken

bool IsCancellationRequested()

Returns if it's cancelled


future getToken()

Returns the future


Functions

static vector ConvertAllItems(vector input, function func)

runs the function for each vector entry and returns the modified vector


static string GetOriginalLoc()

returns the location of the currently running executable


string GetOriginalLoc(const string& filepath)

returns the location of the inputted executable


static Task ToTask(CancellationToken token)

Converts a Cancellation Token to a Task


static bool AttemptResult(Task task, T& result)

Attempts to get the task result and store it to result value, if fails, it will set "default!" to result value. it will return true if it got an result and false if it failed


string GetCurrent()

returns "Windows", "Linux", or "Apple" based on the system it is currently running


string ExeExt()

returns the executable extension supported on the system. ".exe" if on windows and "" on other systems