Beispiel #1
0
        private void Initialize(IEnumerable <Stop> stops, bool isCurrent, DateTime startTime, GeoCoordinate sourceLocation, Stop sourceStop, bool isSmall)
        {
            this.sourceLocation = sourceLocation;
            this.sourceStop     = sourceStop;
            this.startTime      = startTime;
            this.stops          = stops;
            this.isCurrent      = isCurrent;
            initialized         = true;

            var routes = stops.SelectMany(s => s.Routes).Select(r => r.RouteGroup).Distinct().ToList();

            if (routes.Count > 0)
            {
                var firstType = routes.MinBy(r => r.GetCustomTypePriority());
                this.Priority          = firstType.GetCustomTypePriority();
                mainColor              = firstType.GetColors().SecondaryColorBrush;
                FrontPanel.Background  = mainColor;
                FrontPanel.BorderBrush = firstType.GetColors().MainColorBrush;
                HoverEffects.SetBackground(FrameBorder, mainColor);

                if (firstType.Type == RouteType.Metro)
                {
                    SubwayEllipse.Visibility = Visibility.Visible;
                    FrontIcon.FontSize       = 34.0;
                    FrontIcon.Text           = "" + (char)0xF239;
                }
                else if (firstType.Type == RouteType.RailRoad)
                {
                    FrontIcon.Text = "" + (char)0xF239;
                }
                else if (firstType.Type == RouteType.Tram)
                {
                    FrontIcon.Text = "" + (char)0xF238;
                }
                else if (firstType.Type == RouteType.Ferry)
                {
                    FrontIcon.Text = "" + (char)0xf21a;
                }
                //else
                //{
                //    FrontIcon.Text = "" + (char)0xF207;
                //}
            }
            else
            {
                FrontIcon.Text = "" + (char)0xF041;
                isEmpty        = true;
            }

            if (isSmall)
            {
                if (SubwayEllipse.Visibility == Visibility.Visible)
                {
                    SubwayEllipse.Height          = 25;
                    SubwayEllipse.Width           = 25;
                    SubwayEllipse.StrokeThickness = 3;
                }
                FrontIcon.FontSize = FrontIcon.FontSize * 0.5;
            }
        }
Beispiel #2
0
 void Start()
 {
     player       = GameObject.FindGameObjectWithTag("Player").transform;
     inventory    = player.GetComponent <Inventory>();
     hoverEffects = GetComponent <HoverEffects>();
 }