Ferreteria/v2/trait/ftExecutableTwig

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Ferreteria‎ | v2
Revision as of 17:31, 19 January 2019 by Woozle (talk | contribs) (Created page with "{{page/code/class}} * '''file''': {{l/ferreteria/file|page/page.php}} * '''uses''': ''nothing'' * '''used by''': ** {{l/version|class|fcNavBase}} <source lang=php> // PURPOSE:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • file: page/page.php
  • uses: nothing
  • used by:
// PURPOSE: So a node can respond to events (does not pass them down to subnodes)
trait ftExecutableTwig {
    public function DoEvent($nEvent) {
	$this->OnEventDispatch($nEvent);
    }
    protected function OnEventDispatch($nEvent) {
	switch ($nEvent) {
	  case KI_NODE_EVENT_DO_BUILDING:
	    $this->OnCreateElements();
	    break;
	  case KI_NODE_EVENT_DO_FIGURING:
	    $this->OnRunCalculations();
	    break;
	}
    }
    abstract protected function OnCreateElements();
    abstract protected function OnRunCalculations();
}