Пример #1
0
        private void build(int index)
        {
            Debug.Assert(platform is FatPlatform);
            FatPlatform fp = (FatPlatform)platform;

            if (fp.hasLane(index))
            {
                if (fp.canRemoveLane(index))
                {
                    fp.removeLane(index);
                }
                else
                {
                    MainWindow.showError("Could not be released due to an obstacle");
                }
                //! MainWindow.showError("障害物があって解放できません");
            }
            else
            {
                if (fp.canAddLane(index))
                {
                    fp.addLane(index);
                }
                else
                {
                    MainWindow.showError("Could not be connected due to an obstacle");
                }
                //! MainWindow.showError("障害物があって接続できません");
            }
            updateDialog();
        }
Пример #2
0
        public static Platform get(Location loc)
        {
            Platform p = FatPlatform.get(loc);

            if (p != null)
            {
                return(p);
            }

            // TODO: check slim platform
            return(ThinPlatform.get(loc));
        }
Пример #3
0
        private void updateDialog()
        {
            if (platform is FatPlatform)
            {
                FatPlatform fp = (FatPlatform)platform;
                if (!fp.hasLane(lIdx))
                {
                    left.Text = "Left connect";
                }
                //! if(!fp.hasLane(lIdx))	left.Text = "左に接続";
                else
                {
                    left.Text = "Left release";
                }
                //! else					left.Text = "左を解放";
                if (!fp.hasLane(rIdx))
                {
                    right.Text = "Right connect";
                }
                //! if(!fp.hasLane(rIdx))	right.Text = "右に接続";
                else
                {
                    right.Text = "Right release";
                }
                //! else					right.Text = "右を解放";
            }

            if (platform.host != null)
            {
                warning.Hide();
            }
            else
            {
                warning.Show();
            }
        }
Пример #4
0
 public RailRoadImpl(TrafficVoxel v, FatPlatform _owner, int _idx) : base(v, _owner, _idx)
 {
 }
Пример #5
0
 public FatPlatformVoxel(FatPlatform p, Location loc, Sprite _sprite) : base(loc)
 {
     this.owner  = p;
     this.sprite = _sprite;
 }
Пример #6
0
 public FatPlatformVoxel(FatPlatform p, int x, int y, int z, Sprite _sprite)
     : this(p, new Location(x, y, z), _sprite)
 {
 }