Пример #1
0
        public override bool Equals(object obj)
        {
            if (obj is SupraLaneComponentList)
            {
                SupraLaneComponentList other = (SupraLaneComponentList)obj;
                if (other.Count == this.Count)
                {
                    for (int i = 0; i < this.Count; i++)
                    {
                        if (!this[i].Equals(other[i]))
                        {
                            return(false);
                        }
                    }

                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="initial"></param>
        /// <param name="next"></param>
        /// <param name="final"></param>
        public SupraLane(ArbiterLane initial, ArbiterInterconnect next, ArbiterLane final)
        {
            Components = new SupraLaneComponentList();
            Components.Add(initial);
            Components.Add(next);
            Components.Add(final);
            this.Initial      = initial;
            this.Final        = final;
            this.Interconnect = next;

            if (!this.Initial.Equals(this.Final))
            {
                this.supraWaypoints = new List <ArbiterWaypoint>();
                this.supraWaypoints.AddRange(this.Initial.WaypointsInclusive(this.Initial.WaypointList[0], (ArbiterWaypoint)this.Interconnect.InitialGeneric));
                this.supraWaypoints.AddRange(this.Final.WaypointsInclusive((ArbiterWaypoint)this.Interconnect.FinalGeneric, this.Final.WaypointList[this.Final.WaypointList.Count - 1]));
                this.SetDefaultLanePath();
            }
            else
            {
                this.supraWaypoints = this.Initial.WaypointList;
                this.supraPath      = this.Initial.LanePath();
                this.supraPath.Add(this.Interconnect.FinalGeneric.Position);
            }
        }