Merge branch 'master' into history
[potlatch2.git] / net / systemeD / halcyon / connection / Entity.as
index e05462e..c5c6178 100644 (file)
@@ -14,6 +14,7 @@ package net.systemeD.halcyon.connection {
         private var _version:uint;
         private var _uid:Number;
         private var _timestamp:String;
+        private var _user:String;
         private var tags:Object = {};
         private var modified:Boolean = false;
         private var _loaded:Boolean = true;
@@ -25,12 +26,13 @@ package net.systemeD.halcyon.connection {
         /** Have all its parents (ie, relations that contain this object as a member, ways that contain this node) been loaded into memory */
         public var parentsLoaded:Boolean = true;
 
-        public function Entity(connection:Connection, id:Number, version:uint, tags:Object, loaded:Boolean, uid:Number, timestamp:String) {
+        public function Entity(connection:Connection, id:Number, version:uint, tags:Object, loaded:Boolean, uid:Number, timestamp:String, user:String) {
                        this._connection = connection;
             this._id = id;
             this._version = version;
             this._uid = uid;
             this._timestamp = timestamp;
+            this._user = user
             if (connection.cssTransform) tags=connection.cssTransform.run(this,tags);
             this.tags = tags;
                        this._loaded = loaded;
@@ -67,14 +69,19 @@ package net.systemeD.halcyon.connection {
             return _timestamp;
         }
 
+        /** The username who last edited this entity (from OSM API). */
+        public function get user():String {
+            return _user;
+        }
+
                /** Connection to which this entity belongs. */
                public function get connection():Connection {
                        return _connection;
                }
 
         /** Set a bunch of properties in one hit. Implicitly makes entity not deleted. */
-        public function updateEntityProperties(version:uint, tags:Object, loaded:Boolean, parentsLoaded:Boolean, uid:Number, timestamp:String):void {
-            _version=version; this.tags=tags; _loaded=loaded; this.parentsLoaded=parentsLoaded; _uid = uid; _timestamp = timestamp;
+        public function updateEntityProperties(version:uint, tags:Object, loaded:Boolean, parentsLoaded:Boolean, uid:Number, timestamp:String, user:String):void {
+            _version=version; this.tags=tags; _loaded=loaded; this.parentsLoaded=parentsLoaded; _uid = uid; _timestamp = timestamp; _user = user;
             deleted=false;
         }