1: <?php
2: /**
3: * ManiaLive - TrackMania dedicated server manager in PHP
4: *
5: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
6: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
7: * @version $Revision: 280 $:
8: * @author $Author: martin.gwendal $:
9: * @date $Date: 2011-11-07 19:21:52 +0100 (lun., 07 nov. 2011) $:
10: */
11:
12: namespace ManiaLive\Application;
13:
14: // Maybe create events for Preloop/postloop for better performance
15:
16: class Event extends \ManiaLive\Event\Event
17: {
18: const ON_INIT = 1;
19: const ON_RUN = 2;
20: const ON_PRE_LOOP = 4;
21: const ON_POST_LOOP = 8;
22: const ON_TERMINATE = 16;
23:
24: function fireDo($listener)
25: {
26: switch($this->onWhat)
27: {
28: case self::ON_PRE_LOOP: $listener->onPreLoop(); break;
29: case self::ON_POST_LOOP: $listener->onPostLoop(); break;
30: case self::ON_RUN: $listener->onRun(); break;
31: case self::ON_INIT: $listener->onInit(); break;
32: case self::ON_TERMINATE: $listener->onTerminate(); break;
33: }
34: }
35: }
36:
37: ?>