Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
		}//value
		
		public Value( ulong @ulong )
		{
			Vt = Vtype.Ulong;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = ((long)@ulong);
		}//.ctor
Ejemplo n.º 3
0
		}//value
		
		public Value( uint @uint )
		{
			Vt = Vtype.Uint;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @uint;
		}//.ctor
Ejemplo n.º 4
0
		}//value
		
		public Value( bool @bool )
		{
			Vt = Vtype.Bool;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @bool ? 1 : 0;
		}//.ctor
Ejemplo n.º 5
0
		}//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);
        }
Ejemplo n.º 7
0
		}//value
		
		public Value( float @float )
		{
			Vt = Vtype.Float;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Double = @float;
		}//.ctor
Ejemplo n.º 8
0
		}//value
		
		public Value( int @int )
		{
			Vt = Vtype.Int;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @int;
		}//.ctor
Ejemplo n.º 9
0
		}//.ctor
		
		public Value( IObject obj )
		{
			Vt = Vtype.Object;
			Ptr = obj;
			Str = null;
			Dta = new Vdata();
		}//.ctor
Ejemplo n.º 10
0
		}//.ctor
		
		public Value( Value value )
		{
			Vt = value.Vt;
			Ptr = value.Ptr;
			Str = value.Str;
			Dta = value.Dta;
		}//.ctor
Ejemplo n.º 11
0
		}//.ctor
		
		internal Value( Vtype vtype, double @double )
		{
			Vt = vtype;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Double = @double;
		}//.ctor
Ejemplo n.º 12
0
		}//.ctor
		
		internal Value( Vtype vtype, long @long )
		{
			Vt = vtype;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @long;
		}//.ctor
Ejemplo n.º 13
0
		}//.ctor
		
		internal Value( Vtype vtype, Object @object, string @string )
		{
			Vt = vtype;
			Ptr = @object;
			Str = @string;
			Dta = new Vdata();
		}//.ctor
Ejemplo n.º 14
0
		}//.ctor
		
		internal Value( Vtype vtype, Object @object )
		{
			Vt = vtype;
			Ptr = @object;
			Str = null;
			Dta = new Vdata();
		}//.ctor
Ejemplo n.º 15
0
		internal Value( Vtype vtype )
		{
			Vt = vtype;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
		}//.ctor
Ejemplo n.º 16
0
		}//value
		
		public Value( sbyte @sbyte )
		{
			Vt = Vtype.Sbyte;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @sbyte;
		}//.ctor
Ejemplo n.º 17
0
		}//value
		
		public Value( short @short )
		{
			Vt = Vtype.Short;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @short;
		}//.ctor
Ejemplo n.º 18
0
		}//.ctor
		
		public Value( IProp prop )
		{
			Vt = Vtype.Prop;
			Ptr = prop;
			Str = null;
			Dta = new Vdata();
		}//.ctor
Ejemplo n.º 19
0
		}//value
		
		public Value( long @long )
		{
			Vt = Vtype.Long;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Long = @long;
		}//.ctor
Ejemplo n.º 20
0
		}//.ctor
		
		public Value( IProps obj, string @string )
		{
			Vt = Vtype.Ident;
			Ptr = obj;
			Str = @string;
			Dta = new Vdata();
		}//.ctor
Ejemplo n.º 21
0
		}//value
		
		public Value( double @double )
		{
			Vt = Vtype.Double;
			Ptr = null;
			Str = null;
			Dta = new Vdata();
			Dta.Double = @double;
		}//.ctor
Ejemplo n.º 22
0
		}//value
		
		public Value( string @string )
		{
			Vt = Vtype.String;
			Ptr = null;
			Str = @string;
			Dta = new Vdata();
		}//.ctor