Commiting to continue stuff at home
[swf-overlay.git] / BaseRegistry.as
1 package {
2
3 import flash.events.Event;
4 import flash.events.EventDispatcher;
5
6 public class BaseRegistry implements IRegistry {
7
8 protected var stage:Object;
9 protected var head:Object;
10 protected var lastUpdated:Array;
11
12 public function BaseRegistry() {
13 this.stage = {};
14 this.head = {};
15 this.lastUpdated = new Array();
16 }
17
18 public function add(obj:Object):void {
19 this.stage = Util.extend(this.stage, obj);
20 }
21
22 public function commit():void {
23 if(!Util.objectIsEmpty(this.stage)) {
24 this.head = Util.extend(this.head, this.stage);
25 this.lastUpdated = Util.toPropertyChains(this.stage);
26 this.stage = {};
27 }
28 }
29
30 public function get(propChain:String):* {
31 return Util.resolvePropertyChain(propChain, this.head);
32 }
33
34 public function getLastUpdated():Array {
35 return this.lastUpdated;
36 }
37 }
38 }