public void DetermineType(Vertex first, Vertex second) { Vector v1 = first.Coordinate - Coordinate; // "Vector 1" Vector v2 = second.Coordinate - Coordinate; // "Vector 2" var angle = Vector.SignedAngleRad(v1, v2); if (first.Coordinate.y < this.Coordinate.y && second.Coordinate.y < this.Coordinate.y) // start or split { if (angle < Math.PI) { this.Type = Vtype.Start; } if (angle > Math.PI) { this.Type = Vtype.Split; } } else if (first.Coordinate.y > this.Coordinate.y && second.Coordinate.y > this.Coordinate.y) // end or merge { if (angle < Math.PI) { this.Type = Vtype.End; } if (angle > Math.PI) { this.Type = Vtype.Merge; } } else if (first.Coordinate.y > this.Coordinate.y && second.Coordinate.y < this.Coordinate.y || first.Coordinate.y < this.Coordinate.y && second.Coordinate.y > this.Coordinate.y) { this.Type = Vtype.Regular; } }
}//value public Value( ulong @ulong ) { Vt = Vtype.Ulong; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = ((long)@ulong); }//.ctor
}//value public Value( uint @uint ) { Vt = Vtype.Uint; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @uint; }//.ctor
}//value public Value( bool @bool ) { Vt = Vtype.Bool; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @bool ? 1 : 0; }//.ctor
}//value public Value( char @char ) { Vt = Vtype.Char; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @char; }//.ctor
//*Funtions //function for inseting into database row public string[] MakeDBLine() { string[] TheLine = new string[18]; TheLine[0] = ("'" + ViD + "'"); TheLine[1] = Vtype.ToString(); TheLine[2] = ("'" + BornAt.TimeOfDay.ToString() + "'"); TheLine[3] = ("'" + BornLink.StartNode.ToString() + ":" + BornLink.EndNode.ToString() + "'"); if (Routename.Equals("NULL")) { TheLine[4] = "NULL"; } else { TheLine[4] = ("'" + Routename + "'"); } if (Origin != 511) { TheLine[5] = Origin.ToString(); } else { TheLine[5] = "NULL"; } if (Destination != 511) { TheLine[6] = Destination.ToString(); } else { TheLine[6] = "NULL"; } TheLine[7] = Tag.ToString(); TheLine[8] = BornStage.ToString(); TheLine[9] = BornScenario.ToString(); int ObsoleteINT = Convert.ToInt32(Obsolete); TheLine[10] = ("'" + ObsoleteINT.ToString() + "'"); if (MagicNumbers.Equals("[511,511]")) { TheLine[11] = "NULL"; } else { TheLine[11] = ("'" + MagicNumbers + "'"); } TheLine[12] = "NULL"; TheLine[13] = "NULL"; if (NextLink != "NULL") { TheLine[14] = ("'" + NextLink + "'"); } else { TheLine[14] = "NULL"; } if (NextNextLink != "NULL") { TheLine[15] = ("'" + NextNextLink + "'"); } else { TheLine[15] = "NULL"; } TheLine[16] = "NULL6"; //NextTurn TheLine[17] = "NULL6"; //NextNextTurn return(TheLine); }
}//value public Value( float @float ) { Vt = Vtype.Float; Ptr = null; Str = null; Dta = new Vdata(); Dta.Double = @float; }//.ctor
}//value public Value( int @int ) { Vt = Vtype.Int; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @int; }//.ctor
}//.ctor public Value( IObject obj ) { Vt = Vtype.Object; Ptr = obj; Str = null; Dta = new Vdata(); }//.ctor
}//.ctor public Value( Value value ) { Vt = value.Vt; Ptr = value.Ptr; Str = value.Str; Dta = value.Dta; }//.ctor
}//.ctor internal Value( Vtype vtype, double @double ) { Vt = vtype; Ptr = null; Str = null; Dta = new Vdata(); Dta.Double = @double; }//.ctor
}//.ctor internal Value( Vtype vtype, long @long ) { Vt = vtype; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @long; }//.ctor
}//.ctor internal Value( Vtype vtype, Object @object, string @string ) { Vt = vtype; Ptr = @object; Str = @string; Dta = new Vdata(); }//.ctor
}//.ctor internal Value( Vtype vtype, Object @object ) { Vt = vtype; Ptr = @object; Str = null; Dta = new Vdata(); }//.ctor
internal Value( Vtype vtype ) { Vt = vtype; Ptr = null; Str = null; Dta = new Vdata(); }//.ctor
}//value public Value( sbyte @sbyte ) { Vt = Vtype.Sbyte; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @sbyte; }//.ctor
}//value public Value( short @short ) { Vt = Vtype.Short; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @short; }//.ctor
}//.ctor public Value( IProp prop ) { Vt = Vtype.Prop; Ptr = prop; Str = null; Dta = new Vdata(); }//.ctor
}//value public Value( long @long ) { Vt = Vtype.Long; Ptr = null; Str = null; Dta = new Vdata(); Dta.Long = @long; }//.ctor
}//.ctor public Value( IProps obj, string @string ) { Vt = Vtype.Ident; Ptr = obj; Str = @string; Dta = new Vdata(); }//.ctor
}//value public Value( double @double ) { Vt = Vtype.Double; Ptr = null; Str = null; Dta = new Vdata(); Dta.Double = @double; }//.ctor
}//value public Value( string @string ) { Vt = Vtype.String; Ptr = null; Str = @string; Dta = new Vdata(); }//.ctor