|  | @@ -0,0 +1,78 @@
 | 
	
		
			
				|  |  | +import { GenericObject } from "../../objects/generic-object";
 | 
	
		
			
				|  |  | +import { GEO_FILE } from "../../../enums/geo-file-enum";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +export class Action {
 | 
	
		
			
				|  |  | +  constructor(genericObject) {
 | 
	
		
			
				|  |  | +    this.id = genericObject.id;
 | 
	
		
			
				|  |  | +    this.type = genericObject.elementClass;
 | 
	
		
			
				|  |  | +    this.definition = this.r(
 | 
	
		
			
				|  |  | +      genericObject.definitions.map(x => x.id).toString()
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +    this.list = this.r(
 | 
	
		
			
				|  |  | +      genericObject.dependentsOnThis.map(x => x.id).toString()
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +    this.label = genericObject.labelIgeom;
 | 
	
		
			
				|  |  | +    this.defined = genericObject.defined;
 | 
	
		
			
				|  |  | +    this.color = genericObject.color;
 | 
	
		
			
				|  |  | +    this.hidden = genericObject.visible ? 0 : 1;
 | 
	
		
			
				|  |  | +    this.pixel = "";
 | 
	
		
			
				|  |  | +    this.font = "";
 | 
	
		
			
				|  |  | +    this.labelColor = genericObject.labelColor;
 | 
	
		
			
				|  |  | +    this.genericObject = genericObject;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  do() {
 | 
	
		
			
				|  |  | +    const genericObject = new GenericObject(this.id);
 | 
	
		
			
				|  |  | +    genericObject.color = this.color;
 | 
	
		
			
				|  |  | +    genericObject.elementClass = this.type;
 | 
	
		
			
				|  |  | +    genericObject.definition = this.definition;
 | 
	
		
			
				|  |  | +    genericObject.list = this.list;
 | 
	
		
			
				|  |  | +    genericObject.label = this.label;
 | 
	
		
			
				|  |  | +    genericObject.visible = this.hidden == 0;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  toMap() {
 | 
	
		
			
				|  |  | +    const map = new Map();
 | 
	
		
			
				|  |  | +    map.set("key", "value");
 | 
	
		
			
				|  |  | +    return map;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  toString() {
 | 
	
		
			
				|  |  | +    return (
 | 
	
		
			
				|  |  | +      "{" +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.ID, this.id)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.TYPE, this.type)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.DEFINITION, this.definition)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.LIST, this.list)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.LABEL, this.label)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.DEFINED, this.defined)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.COLOR, this.color)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.HIDDEN, this.hidden)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.PIXEL, this.pixel)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.FONT, this.font)}, ` +
 | 
	
		
			
				|  |  | +      `${this.d(GEO_FILE.LABEL_COLOR, this.labelColor)}` +
 | 
	
		
			
				|  |  | +      `}!\n`
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  d(key, value) {
 | 
	
		
			
				|  |  | +    return `${key}:${value}`;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  r(str) {
 | 
	
		
			
				|  |  | +    return str.replace(",", " ");
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  rehydrate() {
 | 
	
		
			
				|  |  | +    this.id = this.genericObject.id;
 | 
	
		
			
				|  |  | +    this.type = this.genericObject.elementClass;
 | 
	
		
			
				|  |  | +    this.definition = this.r(
 | 
	
		
			
				|  |  | +      this.genericObject.definitions.map(x => x.id).toString()
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +    this.list = this.r(
 | 
	
		
			
				|  |  | +      this.genericObject.dependentsOnThis.map(x => x.id).toString()
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +    this.label = this.genericObject.labelIgeom;
 | 
	
		
			
				|  |  | +    this.defined = this.genericObject.defined;
 | 
	
		
			
				|  |  | +    this.color = this.genericObject.color;
 | 
	
		
			
				|  |  | +    this.hidden = this.genericObject.visible ? 0 : 1;
 | 
	
		
			
				|  |  | +    this.pixel = "";
 | 
	
		
			
				|  |  | +    this.font = "";
 | 
	
		
			
				|  |  | +    this.labelColor = "";
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 |