Merge branch 'master' into history
[potlatch2.git] / net / systemeD / halcyon / styleparser / InstructionStyle.as
1 package net.systemeD.halcyon.styleparser {
2
3         public class InstructionStyle extends Style {
4
5                 public var set_tags:Object={};
6                 public var breaker:Boolean=false;
7                 public var set_tags_order:Array=[];
8
9                 public function addSetTag(k:String,v:*):void {
10                         if (v is Eval) { evals[k]=v; }
11                         else if (v is TagValue) { tagvalues[k]=v; }
12                         
13                         edited=true;
14                         set_tags_order.push(k);
15                         set_tags[k]=v;
16                 }
17
18                 public function assignSetTags(tags:Object):void {
19                         for (var i:uint=0; i<set_tags_order.length; i++) {
20                                 var k:String=set_tags_order[i];
21                                 var v:*=set_tags[k];
22                                 if (v is TagValue) { v=v.getValue(tags); }
23                                 if (v=='') { delete tags[k]; }
24                                 else { tags[k]=v; }
25                         }
26                 }
27         }
28
29 }