// Generated by Haxe 4.3.3
package schema;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class Line extends haxe.lang.HxObject
{
	public Line(haxe.lang.EmptyObject empty)
	{
	}
	
	
	public Line(java.lang.Object start, java.lang.Object end)
	{
		//line 9 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		schema.Line.__hx_ctor_schema_Line(this, start, end);
	}
	
	
	protected static void __hx_ctor_schema_Line(schema.Line __hx_this, java.lang.Object start, java.lang.Object end)
	{
		//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		__hx_this.start = start;
		//line 11 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		__hx_this.end = end;
	}
	
	
	public java.lang.Object start;
	
	public java.lang.Object end;
	
	public double getSteering()
	{
		//line 16 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		return ( ((double) ((( ((int) (haxe.lang.Runtime.getField_f(this.end, "y", true)) ) - ((int) (haxe.lang.Runtime.getField_f(this.start, "y", true)) ) ))) ) / (( ((int) (haxe.lang.Runtime.getField_f(this.end, "x", true)) ) - ((int) (haxe.lang.Runtime.getField_f(this.start, "x", true)) ) )) );
	}
	
	
	public double getOffset()
	{
		//line 20 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		return ( ((double) (((int) (haxe.lang.Runtime.getField_f(this.end, "y", true)) )) ) - ((double) (( ((double) (this.getSteering()) ) * ((double) (((int) (haxe.lang.Runtime.getField_f(this.end, "x", true)) )) ) )) ) );
	}
	
	
	public java.lang.Object getLabelPos(java.lang.String card, boolean inverted, int pos)
	{
		//line 24 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		java.lang.Object rStart = ( (inverted) ? (this.end) : (this.start) );
		//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		java.lang.Object rEnd = ( (inverted) ? (this.start) : (this.end) );
		//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		int x = ( (( ((int) (haxe.lang.Runtime.getField_f(rEnd, "x", true)) ) >= ((int) (haxe.lang.Runtime.getField_f(rStart, "x", true)) ) )) ? (( ((int) (haxe.lang.Runtime.getField_f(rStart, "x", true)) ) + 3 )) : (( ( ((int) (haxe.lang.Runtime.getField_f(rStart, "x", true)) ) - ((int) (((int) (((double) (( 10 * card.length() )) )) )) ) ) - 3 )) );
		//line 27 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		int y = ( (( ((int) (haxe.lang.Runtime.getField_f(rEnd, "y", true)) ) >= ((int) (haxe.lang.Runtime.getField_f(rStart, "y", true)) ) )) ? (( ((int) (haxe.lang.Runtime.getField_f(rStart, "y", true)) ) + ( 16 * pos ) )) : (( ( ((int) (haxe.lang.Runtime.getField_f(rStart, "y", true)) ) - ((int) (3) ) ) - ( 16 * (( pos - 1 )) ) )) );
		//line 28 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		return new haxe.lang.DynamicObject(new java.lang.String[]{}, new java.lang.Object[]{}, new java.lang.String[]{"x", "y"}, new double[]{((double) (((double) (x) )) ), ((double) (((double) (y) )) )});
	}
	
	
	@Override public double __hx_setField_f(java.lang.String field, double value, boolean handleProperties)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				switch (field.hashCode())
				{
					case 100571:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("end")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							this.end = ((java.lang.Object) (value) );
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return value;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 109757538:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("start")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							this.start = ((java.lang.Object) (value) );
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return value;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				return super.__hx_setField_f(field, value, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_setField(java.lang.String field, java.lang.Object value, boolean handleProperties)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				switch (field.hashCode())
				{
					case 100571:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("end")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							this.end = ((java.lang.Object) (value) );
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return value;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 109757538:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("start")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							this.start = ((java.lang.Object) (value) );
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return value;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				return super.__hx_setField(field, value, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_getField(java.lang.String field, boolean throwErrors, boolean isCheck, boolean handleProperties)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				switch (field.hashCode())
				{
					case 118629430:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("getLabelPos")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getLabelPos")) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 109757538:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("start")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return this.start;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 676235145:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("getOffset")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getOffset")) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 100571:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("end")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return this.end;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case -797809177:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("getSteering")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getSteering")) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				return super.__hx_getField(field, throwErrors, isCheck, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public double __hx_getField_f(java.lang.String field, boolean throwErrors, boolean handleProperties)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				switch (field.hashCode())
				{
					case 100571:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("end")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return ((double) (haxe.lang.Runtime.toDouble(this.end)) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 109757538:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("start")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return ((double) (haxe.lang.Runtime.toDouble(this.start)) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				return super.__hx_getField_f(field, throwErrors, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_invokeField(java.lang.String field, java.lang.Object[] dynargs)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				switch (field.hashCode())
				{
					case 118629430:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("getLabelPos")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return this.getLabelPos(haxe.lang.Runtime.toString(dynargs[0]), haxe.lang.Runtime.toBool(((java.lang.Boolean) (dynargs[1]) )), ((int) (haxe.lang.Runtime.toInt(dynargs[2])) ));
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case -797809177:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("getSteering")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return this.getSteering();
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
					case 676235145:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						if (field.equals("getOffset")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
							return this.getOffset();
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				return super.__hx_invokeField(field, dynargs);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public void __hx_getFields(haxe.root.Array<java.lang.String> baseArr)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		baseArr.push("end");
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		baseArr.push("start");
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Line.hx"
		super.__hx_getFields(baseArr);
	}
	
	
}


