// Generated by Haxe 4.3.3
package schema;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class Curve extends schema.Line
{
	public Curve(haxe.lang.EmptyObject empty)
	{
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		super(haxe.lang.EmptyObject.EMPTY);
	}
	
	
	public Curve(java.lang.Object start, java.lang.Object end, int xDst, int yDst)
	{
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		super(haxe.lang.EmptyObject.EMPTY);
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		schema.Curve.__hx_ctor_schema_Curve(this, start, end, xDst, yDst);
	}
	
	
	protected static void __hx_ctor_schema_Curve(schema.Curve __hx_this, java.lang.Object start, java.lang.Object end, int xDst, int yDst)
	{
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		schema.Line.__hx_ctor_schema_Line(__hx_this, start, end);
		//line 9 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		__hx_this.setMiddle(xDst, yDst);
	}
	
	
	public java.lang.Object middle;
	
	public void setMiddle(int xDst, int yDst)
	{
		//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		int cx = ((int) (( ((int) (haxe.lang.Runtime.getField_f(this.start, "x", true)) ) + ( ((double) ((( ((int) (haxe.lang.Runtime.getField_f(this.end, "x", true)) ) - ((int) (haxe.lang.Runtime.getField_f(this.start, "x", true)) ) ))) ) / 2 ) )) );
		//line 14 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		int cy = ((int) (( ((int) (haxe.lang.Runtime.getField_f(this.start, "y", true)) ) + ( ((double) ((( ((int) (haxe.lang.Runtime.getField_f(this.end, "y", true)) ) - ((int) (haxe.lang.Runtime.getField_f(this.start, "y", true)) ) ))) ) / 2 ) )) );
		//line 15 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		int mx = 0;
		//line 16 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		int my = 0;
		//line 17 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		if (( ((int) (haxe.lang.Runtime.getField_f(this.start, "x", true)) ) == ((int) (haxe.lang.Runtime.getField_f(this.end, "x", true)) ) )) 
		{
			//line 18 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			mx = ( ((int) (haxe.lang.Runtime.getField_f(this.start, "x", true)) ) + xDst );
			//line 19 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			my = cy;
		}
		else
		{
			//line 20 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (( ((int) (haxe.lang.Runtime.getField_f(this.start, "y", true)) ) == ((int) (haxe.lang.Runtime.getField_f(this.end, "y", true)) ) )) 
			{
				//line 21 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				mx = cx;
				//line 22 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				my = ( ((int) (haxe.lang.Runtime.getField_f(this.start, "y", true)) ) - ((int) (yDst) ) );
			}
			else
			{
				//line 24 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				double angle = java.lang.Math.atan(( ((double) ( - ((( ((int) (haxe.lang.Runtime.getField_f(this.end, "x", true)) ) - ((int) (haxe.lang.Runtime.getField_f(this.start, "x", true)) ) ))) ) ) / (( ((int) (haxe.lang.Runtime.getField_f(this.end, "y", true)) ) - ((int) (haxe.lang.Runtime.getField_f(this.start, "y", true)) ) )) ));
				//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				mx = ((int) (( cx + ( java.lang.Math.cos(angle) * xDst ) )) );
				//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				my = ((int) (( cy + ( java.lang.Math.sin(angle) * yDst ) )) );
				//line 27 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				if (( ( ( yDst < 0 ) && ( cy > my ) ) || ( ( yDst > 0 ) && ( cy < my ) ) )) 
				{
					//line 28 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
					my = ((int) (( cy + ( java.lang.Math.sin(angle) *  - (yDst)  ) )) );
				}
				
			}
			
		}
		
		//line 31 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		this.middle = new haxe.lang.DynamicObject(new java.lang.String[]{}, new java.lang.Object[]{}, new java.lang.String[]{"x", "y"}, new double[]{((double) (((double) (mx) )) ), ((double) (((double) (my) )) )});
	}
	
	
	@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/Curve.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				switch (field.hashCode())
				{
					case -1074341483:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						if (field.equals("middle")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							this.middle = ((java.lang.Object) (value) );
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							return value;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				return super.__hx_setField_f(field, value, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.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/Curve.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				switch (field.hashCode())
				{
					case -1074341483:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						if (field.equals("middle")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							this.middle = ((java.lang.Object) (value) );
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							return value;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				return super.__hx_setField(field, value, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.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/Curve.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				switch (field.hashCode())
				{
					case 407056535:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						if (field.equals("setMiddle")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "setMiddle")) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						break;
					}
					
					
					case -1074341483:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						if (field.equals("middle")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							return this.middle;
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				return super.__hx_getField(field, throwErrors, isCheck, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.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/Curve.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				switch (field.hashCode())
				{
					case -1074341483:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						if (field.equals("middle")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							return ((double) (haxe.lang.Runtime.toDouble(this.middle)) );
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				return super.__hx_getField_f(field, throwErrors, handleProperties);
			}
			else
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.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/Curve.hx"
		{
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			boolean __temp_executeDef1 = true;
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (( field != null )) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				switch (field.hashCode())
				{
					case 407056535:
					{
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						if (field.equals("setMiddle")) 
						{
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							__temp_executeDef1 = false;
							//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
							this.setMiddle(((int) (haxe.lang.Runtime.toInt(dynargs[0])) ), ((int) (haxe.lang.Runtime.toInt(dynargs[1])) ));
						}
						
						//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
			if (__temp_executeDef1) 
			{
				//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
				return super.__hx_invokeField(field, dynargs);
			}
			
		}
		
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		return 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/Curve.hx"
		baseArr.push("middle");
		//line 4 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/schema/Curve.hx"
		super.__hx_getFields(baseArr);
	}
	
	
}


