Special Thanks to KacKLaPPen23 and iNViSiBiLiTi for making this guide possible and being generally excellent people!
Programming Duck PCBs with O2D is a notoriously shitty experience.
Luckily with O2D 1.10 and this guide it will be less shitty!
#pragma once | |
/** | |
* This is a quick abstraction over non-blocking asynchronous deferreds. In a | |
* way you can see those as non-blocking futures (whereas std::future are | |
* blocking). | |
* This implementation is devoid of fanciness. Amongst other things: | |
* - Deferreds are not cancelable | |
* - They are not threadsafe. Callbacks are ran in whichever thread the | |
* deferred was triggered and there's no mutex to protect from race condition | |
* while registering callbacks/setting values. This is what we use libev |
For background and further references see: Entity Component Systems on Wikipedia
entity
= class: no logic + no data OR at most small set of frequently used data (ie position)component
= class: logic + dataforeach entity in allEntities do
foreach component in entity.components do
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |