Exemplo n.º 1
0
        /// <summary>
        /// Removes this platform from the world.
        /// </summary>
        public override void remove()
        {
            WorldDefinition world = WorldDefinition.World;

            onHostDisconnected();


            foreach (YardRailRoad[] yrrs in lanes)
            {
                if (yrrs != null)
                {
                    foreach (YardRailRoad yrr in yrrs)
                    {
                        // canRemove must be true before this method is called.
                        Debug.Assert(yrr.Voxel.car == null);

                        Location loc = yrr.Location;
                        yrr.Voxel.railRoad = null;
                        new SingleRailRoad(
                            TrafficVoxel.getOrCreate(loc),
                            RailPattern.get(direction, direction.opposite));
                        world.OnVoxelUpdated(loc);
                    }
                }
            }

            // remove the platform itself
            foreach (FatPlatformVoxel pv in voxels)
            {
                world.remove(pv.Location);
                world.OnVoxelUpdated(pv.Location);
            }

            base.remove();
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="view"></param>
        /// <param name="loc"></param>
        /// <param name="ab"></param>
        public virtual void OnMouseMove(MapViewWindow view, Location loc, Point ab)
        {
            WorldDefinition w = WorldDefinition.World;

            if (location != loc)
            {
                // the current location is moved.
                // update the screen
                w.OnVoxelUpdated(CurrentCube);
                location = loc;
                w.OnVoxelUpdated(CurrentCube);
            }
        }