示例#1
0
        public TrackVehicle(TrackVehicleInfo info) : base(info)
        {
            ControlAssembly = info.controlAssembly;

            trackVehicleInfo = info;
            Length           = 0.05f;
            Width            = 0.5f;
            Height           = 0.05f;
            Color            = Color.Yellow;

            shuttleConveyor = new StraightTransportSection(Core.Environment.Scene.DefaultColor, 0.1f, 0.1f)
            {
                Height = 0.05f
            };

            shuttleAP          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP2         = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP.OnEnter += ShuttleAP_OnEnter;
            shuttleConveyor.Route.Motor.Stop();
            shuttleConveyor.Visible = false;
            Track  = info.trackRail;
            DestAP = Track.Route.InsertActionPoint(info.moveToDistance);
            Track.Route.Add(this, info.moveToDistance);

            DestAP.Visible  = false;
            DestAP.OnEnter += MoveTo_OnEnter;
            Deletable       = false;
            UserDeletable   = false;
            Embedded        = true;
            Stop();
            Load.Items.Add(this);

            Core.Environment.Scene.OnLoaded += Scene_OnLoaded;
        }
示例#2
0
        private void Arrived(Core.Loads.Load load, Core.Routes.ActionPoint ap)
        {
            float y = ap.Position.Y - loadMover.Position.Y + load.Height + loadMover.Height / 2;

            yMoverTimer.Start(new Microsoft.DirectX.Vector3(0, y, 0), Math.Abs(y) * 2);

            Core.Timer.Action(() => Drop(load, ap), Math.Abs(y) * 2 + 1);
        }
示例#3
0
        private void MoveTo_OnEnter(Core.Routes.ActionPoint sender, Load load)
        {
            Stop();
            Track.Route.Motor.Stop(); // Don't know if we really need to do this

            if (OnVehicleArrived != null)
            {
                OnVehicleArrived(this, new EventArgs());
            }
        }
示例#4
0
        private void Drop(Core.Loads.Load load, Core.Routes.ActionPoint ap)
        {
            float y = vertMover.Position.Y - leftframe.Height + horzMover.Height / 2;

            loadMover.UnAttach();
            load.Switch(ap);
            load.Stop();

            yMoverTimer.Start(new Microsoft.DirectX.Vector3(0, -y, 0), Math.Abs(y) * 2);

            Core.Timer.Action(() => Completed(load), Math.Abs(y) * 2 + 1);
        }
示例#5
0
        void destination_Enter(Core.Routes.ActionPoint sender, Load load)
        {
            shuttlecar.Stop();
            route.Motor.Stop();
            finishedmoving = true;

            if (ThisElevator != null) //if the shuttle is used as an elevator pass control back to elevator
            {
                ThisElevator.ElevatorOnArrived();
            }
            else
            {
                ThisShuttle.ShuttleOnArrived();
            }
        }