亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? elevator.cs

?? 設(shè)計(jì)一個(gè)電梯模擬系統(tǒng)。主要用于實(shí)現(xiàn)
?? CS
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
			this.Controls.Add(this.upButton1);
			this.Controls.Add(this.floor1);
			this.Controls.Add(this.elevator2);
			this.Controls.Add(this.elevator1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
			this.MaximizeBox = false;
			this.Name = "Elevator";
			this.Text = "Elevator";
			this.elevator1.ResumeLayout(false);
			this.elevator2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Elevator());
		}
		//Click of buttons in elevators
		private void elevatorButton_Click(object sender, System.EventArgs e)
		{
			System.Windows.Forms.Button tmp = (System.Windows.Forms.Button)sender;						
			if(passengerE1 > 0)
			{
				if(sender == elevatorButton11 && elevator1.Top != floor1.Top)
					destination1[1]++;
				if(sender == elevatorButton12 && elevator1.Top != floor2.Top)
					destination1[2]++;
				if(sender == elevatorButton13 && elevator1.Top != floor3.Top)
					destination1[3]++;
				if(sender == elevatorButton14 && elevator1.Top != floor4.Top)
					destination1[4]++;
			}
			else if(passengerE2 > 0)
			{
				if(sender == elevatorButton21 && elevator2.Top != floor1.Top)
					destination2[1]++;
				if(sender == elevatorButton22 && elevator2.Top != floor2.Top)
					destination2[2]++;
				if(sender == elevatorButton23 && elevator2.Top != floor3.Top)
					destination2[3]++;
				if(sender == elevatorButton24 && elevator2.Top != floor4.Top)
					destination2[4]++;
			}
			tmp.Enabled = false;
			tmp.BackColor = System.Drawing.Color.Yellow;
		}
		//Click of inbuttons and outbuttons of elevator1
		private void pressButton1_Click(object sender, System.EventArgs e)
		{
			System.Windows.Forms.Button tmp = (System.Windows.Forms.Button)sender;
			if (sender == inButton21 || sender == inButton11 || sender == inButton31 || sender == inButton41)
				if(passengerE1 < 10)
					++passengerE1;
			if (sender == outButton22 || sender == outButton12 || sender == outButton32 || sender == outButton42)
				if(passengerE1 > 0)
					--passengerE1;
			tmp.BackColor = System.Drawing.Color.Yellow;
			elevatorTextBox1.Text = passengerE1.ToString ();
		}
		//Click of inbuttons and outbuttons of elevator2
		private void pressButton2_Click(object sender, System.EventArgs e)
		{
			System.Windows.Forms.Button tmp = (System.Windows.Forms.Button)sender;
			if (sender == inButton23 || sender == inButton13 || sender == inButton33 || sender == inButton43)
				if(passengerE2 < 10)
					++passengerE2;
			if (sender == outButton24 || sender == outButton14 || sender == outButton34 || sender == outButton44)
				if(passengerE2 > 0)
					--passengerE2;
			tmp.BackColor = System.Drawing.Color.Yellow;
			elevatorTextBox2.Text = passengerE2.ToString();
		}

		//Click of upbuttons and downbuttons
		private void pressButton3_Click(object sender, System.EventArgs e)
		{
			System.Windows.Forms.Button tmp = (System.Windows.Forms.Button)sender;
			tmp.BackColor = System.Drawing.Color.Yellow;
			if(sender == upButton1 && elevator1.Top != floor1.Top && elevator2.Top != floor1.Top)
				unhandled[0,1] = true;
			if(sender == upButton2 && elevator1.Top != floor2.Top && elevator2.Top != floor2.Top)
				unhandled[0,2] = true;
			if(sender == upButton3 && elevator1.Top != floor3.Top && elevator2.Top != floor3.Top)
				unhandled[0,3] = true;
			if(sender == downButton2 && elevator1.Top != floor2.Top && elevator2.Top != floor2.Top)
				unhandled[1,2] = true;
			if(sender == downButton3 && elevator1.Top != floor3.Top && elevator2.Top != floor3.Top)
				unhandled[1,3] = true;
			if(sender == downButton4 && elevator1.Top != floor4.Top && elevator2.Top != floor4.Top)
				unhandled[1,4] = true;
		}

		private void timerControl_Tick(object sender, System.EventArgs e)
		{
			//Assign the current missions to one of the elevators
			assignMission();
			//Elevators approach one of its destinations
			touchDownE1();
			touchDownE2();
			//Set the direction and adjust their properties
			setDirection();
			adjustProperty();
			//Suspend when reaching any floor
			suspendE1();
			suspendE2();

			moveUpDown();
		}
		private void assignMission ()
		{
			if (unhandled[1,4])					//DownButton4
			{
				if ((floor4.Top > elevator1.Top && directE1 == (int)Direct.UP) || (floor4.Top > elevator2.Top && directE2 == (int)Direct.UP))
				{
					if (directE1 == (int)Direct.HALT)
						destination2[4] = 1;
					else if (directE2 == (int)Direct.HALT)
						destination1[4] = 1;
					else if (floor3.Top-elevator1.Top < floor3.Top-elevator2.Top)
						destination1[4] = 1;
					else 
						destination2[4] = 1;
					unhandled[1,4] = false;
				}
				else if (directE1 == (int)Direct.HALT || directE2 == (int)Direct.HALT)
				{
					if (directE1 != (int)Direct.HALT)
						destination2[4] = 1;
					else if (directE2 != (int)Direct.HALT)
						destination1[4] = 1;
					else if (Math.Abs(floor4.Top-elevator1.Top) < Math.Abs(floor4.Top-elevator2.Top))
						destination1[4] = 1;
					else
						destination2[4] = 1;
					unhandled[1,4] = false;
				}
			}
			if (unhandled[0,3])					//UpButton3
			{
				if ((floor3.Top > elevator1.Top && directE1 == (int)Direct.UP) || (floor3.Top > elevator2.Top && directE2 == (int)Direct.UP))
				{
					if (directE2 == (int)Direct.HALT)
						destination2[3] = 1;
					else if (directE2 == (int)Direct.HALT)
						destination1[3] = 1;
					else if (floor3.Top-elevator1.Top < floor3.Top-elevator2.Top)
						destination1[3] = 1;
					else 
						destination2[3] = 1;
					unhandled[0,3] = false;
				}
				else if (directE1 == (int)Direct.HALT || directE2 == (int)Direct.HALT)
				{
					if (directE1 != (int)Direct.HALT)
						destination2[3] = 1;
					else if (directE2 != (int)Direct.HALT)
						destination1[3] = 1;
					else if (Math.Abs(floor3.Top-elevator1.Top) < Math.Abs(floor3.Top-elevator2.Top))
						destination1[3] = 1;
					else
						destination2[3] = 1;
					unhandled[0,3] = false;
				}
			}
			if (unhandled[1,3])					//DownButton3
			{
				if ((floor3.Top < elevator1.Top && directE1 == (int)Direct.DOWN) || (floor3.Top < elevator2.Top && directE2 == (int)Direct.DOWN))
				{ 
					if (directE2 == (int)Direct.HALT)
						destination2[3] = 1;
					else if (directE2 == (int)Direct.HALT)
						destination1[3] = 1;
					else if (floor3.Top-elevator1.Top < floor3.Top-elevator2.Top)
						destination2[3] = 1;
					else 
						destination1[3] = 1;
					unhandled[1,3] = false;
				}
				else if (directE1 == (int)Direct.HALT || directE2 == (int)Direct.HALT)
				{
					if (directE1 != (int)Direct.HALT)
						destination2[3] = 1;
					else if (directE2 != (int)Direct.HALT)
						destination1[3] = 1;
					else if (Math.Abs(floor3.Top-elevator1.Top) < Math.Abs(floor3.Top-elevator2.Top))
						destination1[3] = 1;
					else
						destination2[3] = 1;
					unhandled[1,3] = false;
				}
			}
			if (unhandled[0,2])					//UpButton2
			{
				if ((floor2.Top > elevator1.Top && directE1 == (int)Direct.UP) || (floor2.Top > elevator2.Top && directE2 == (int)Direct.UP))
				{
					if (directE2 == (int)Direct.HALT)
						destination2[2] = 1;
					else if (directE2 == (int)Direct.HALT)
						destination1[2] = 1;
					else if (floor2.Top-elevator1.Top < floor2.Top-elevator2.Top)
						destination1[2] = 1;
					else 
						destination2[2] = 1;
					unhandled[0,2] = false;
				}
				else if (directE1 == (int)Direct.HALT || directE2 == (int)Direct.HALT)
				{
					if (directE1 != (int)Direct.HALT)
						destination2[2] = 1;
					else if (directE2 != (int)Direct.HALT)
						destination1[2] = 1;
					else if (Math.Abs(floor2.Top-elevator1.Top) < Math.Abs(floor2.Top-elevator2.Top))
						destination1[2] = 1;
					else
						destination2[2] = 1;
					unhandled[0,2] = false;
				}
			}
			if (unhandled[1,2])					//DownButton2
			{
				if ((floor2.Top < elevator1.Top && directE1 == (int)Direct.DOWN) || (floor2.Top < elevator2.Top && directE2 == (int)Direct.DOWN))
				{
					if (directE2 == (int)Direct.HALT)
						destination2[2] = 1;
					else if (directE2 == (int)Direct.HALT)
						destination1[2] = 1;
					else if (floor2.Top-elevator1.Top < floor2.Top-elevator2.Top)
						destination2[2] = 1;
					else 
						destination1[2] = 1;
					unhandled[1,2] = false;
				}
				else if (directE1 == (int)Direct.HALT || directE2 == (int)Direct.HALT)
				{
					if (directE1 != (int)Direct.HALT)
						destination2[2] = 1;
					else if (directE2 != (int)Direct.HALT)
						destination1[2] = 1;
					else if (Math.Abs(floor2.Top-elevator1.Top) < Math.Abs(floor2.Top-elevator2.Top))
						destination1[2] = 1;
					else
						destination2[2] = 1;
					unhandled[1,2] = false;
				}
			}
			if (unhandled[0,1])					//UpButton1
			{
				if ((floor1.Top < elevator1.Top && directE1 == (int)Direct.DOWN) || (floor1.Top < elevator2.Top && directE2 == (int)Direct.DOWN))
				{
					if (directE2 == (int)Direct.HALT)
						destination2[1] = 1;
					else if (directE2 == (int)Direct.HALT)
						destination1[1] = 1;
					else if (floor1.Top-elevator1.Top < floor1.Top-elevator2.Top)
						destination2[1] = 1;
					else 
						destination1[1] = 1;
					unhandled[0,1] = false;
				}
				else if (directE1 == (int)Direct.HALT || directE2 == (int)Direct.HALT)
				{
					if (directE1 != (int)Direct.HALT)
						destination2[1] = 1;
					else if (directE2 != (int)Direct.HALT)
						destination1[1] = 1;
					else if (Math.Abs(floor2.Top-elevator1.Top) < Math.Abs(floor2.Top-elevator2.Top))
						destination1[1] = 1;
					else
						destination2[1] = 1;
					unhandled[0,1] = false;
				}
			}
		}
		private void touchDownE1 ()
		{
			//Elevator1 approaches one of the floors
			if (directE1 != (int)Direct.HALT && suspendTime1 == 0)	
			{
				if (elevator1.Top == floor1.Top && destination1[1] > 0)
				{
					inButton11.Enabled = true;
					outButton12.Enabled = true;
					elevatorButton12.Enabled = true;
					elevatorButton13.Enabled = true;
					elevatorButton14.Enabled = true;
					upButton1.BackColor = System.Drawing.SystemColors.Control;
					elevatorButton11.Enabled = false;
					elevatorButton11.BackColor = System.Drawing.SystemColors.Control;
					destination1[1]--;
					suspendTime1 = 300;
					directE1 = (int)Direct.HALT;
				}
				else if (elevator1.Top == floor2.Top && destination1[2] > 0)
				{
					if (downButton2.BackColor == System.Drawing.Color.Yellow || upButton2.BackColor==System.Drawing.Color.Yellow)
					{
						downButton2.BackColor = System.Drawing.SystemColors.Control;
						upButton2.BackColor = System.Drawing.SystemColors.Control;
					}
					else
					{
						if (directE1 == (int)Direct.DOWN)
							downButton2.BackColor = System.Drawing.SystemColors.Control;
						else
							upButton2.BackColor = System.Drawing.SystemColors.Control;
					}
					inButton21.Enabled = true;
					outButton22.Enabled = true;
					elevatorButton11.Enabled = true;
					elevatorButton13.Enabled = true;
					elevatorButton14.Enabled = true;
					elevatorButton12.Enabled = false;
					elevatorButton12.BackColor = System.Drawing.SystemColors.Control;
					destination1[2]--;
					suspendTime1 = 300;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国三级在线一区| 麻豆专区一区二区三区四区五区| 久久精品一区四区| 3d动漫精品啪啪| 精品国一区二区三区| 欧美精品久久久久久久多人混战 | 日韩午夜激情视频| www国产精品av| 亚洲女人****多毛耸耸8| 肉丝袜脚交视频一区二区| 精品在线一区二区| 国内一区二区视频| 97se亚洲国产综合自在线不卡| 欧美日韩日本视频| 中文字幕高清一区| 天堂久久一区二区三区| 国产福利一区在线| 欧美肥妇bbw| 亚洲精品大片www| 国产永久精品大片wwwapp| 欧洲国产伦久久久久久久| 国产亚洲精品aa午夜观看| 五月天激情综合| 成人午夜又粗又硬又大| 日韩精品自拍偷拍| 亚洲一二三区在线观看| 国产成人在线看| 日韩欧美一区二区视频| 亚洲最大的成人av| 99亚偷拍自图区亚洲| 日韩美女视频一区二区在线观看| 亚洲一区视频在线| 日韩精品五月天| 91久久香蕉国产日韩欧美9色| 国产婷婷一区二区| 国产一区在线看| 日韩一级高清毛片| zzijzzij亚洲日本少妇熟睡| 精品亚洲成a人| 成人黄色国产精品网站大全在线免费观看 | 日本一区二区免费在线观看视频| 国产精品免费av| 亚洲国产精品精华液网站| 婷婷一区二区三区| 免费亚洲电影在线| eeuss鲁一区二区三区| 在线视频你懂得一区| 欧美一区二区三区视频免费播放 | 国产永久精品大片wwwapp| 日韩av在线播放中文字幕| 激情文学综合丁香| 日本乱码高清不卡字幕| 色国产综合视频| 精品国产免费久久| 亚洲天堂网中文字| 亚洲午夜久久久久久久久久久| 日韩 欧美一区二区三区| 国产美女精品在线| 欧美网站大全在线观看| 欧美一区在线视频| 国产精品国产自产拍高清av| 日韩国产成人精品| 91影院在线免费观看| 777午夜精品视频在线播放| 久久九九全国免费| 三级久久三级久久| 91久久久免费一区二区| 精品人在线二区三区| 亚洲午夜精品在线| 99久久国产综合精品女不卡| 欧美精品99久久久**| 亚洲欧美一区二区在线观看| 日本在线不卡视频一二三区| 99久久精品国产网站| 国产色爱av资源综合区| 免费在线成人网| 欧美日韩免费在线视频| 亚洲天堂成人在线观看| 国产高清不卡二三区| 26uuu国产电影一区二区| 首页国产欧美日韩丝袜| 成人91在线观看| 久久新电视剧免费观看| 视频一区国产视频| 成人av电影免费观看| 欧美麻豆精品久久久久久| 一色屋精品亚洲香蕉网站| 懂色av一区二区三区免费看| 精品欧美一区二区三区精品久久 | 91久久国产综合久久| 亚洲日本在线视频观看| 色婷婷综合五月| 亚洲午夜久久久久久久久电影院| 欧美猛男超大videosgay| 日本网站在线观看一区二区三区| 欧美成人vps| 不卡视频免费播放| 亚洲一级不卡视频| 精品剧情在线观看| 成人网在线播放| 亚洲资源中文字幕| 精品99久久久久久| 99久久婷婷国产综合精品电影| 亚洲高清免费在线| 精品sm在线观看| 色88888久久久久久影院野外 | 国产不卡在线一区| 亚洲国产精品久久人人爱| 日韩欧美国产一区在线观看| 成人视屏免费看| 亚洲二区在线观看| 国产亚洲欧美一区在线观看| 色婷婷久久久综合中文字幕| 久久国产精品99久久久久久老狼| 国产精品久线在线观看| 欧美老人xxxx18| 99视频在线精品| 极品尤物av久久免费看| 亚洲精品欧美在线| 国产午夜精品在线观看| 欧美日韩精品一区二区三区蜜桃| 福利一区二区在线| 日本成人在线网站| 一区二区三区影院| 国产日韩成人精品| 日韩你懂的在线观看| 欧美视频在线一区二区三区 | 精品在线播放免费| 午夜国产精品一区| 亚洲精品国产品国语在线app| 精品国产三级a在线观看| 欧美日韩亚洲综合一区| 99免费精品在线| 国产成人免费高清| 国产乱码精品一区二区三区av| 五月天一区二区| 亚洲国产va精品久久久不卡综合| 国产精品你懂的在线| 国产网站一区二区三区| 精品sm捆绑视频| 精品久久久久久最新网址| 欧美美女喷水视频| 欧美日韩和欧美的一区二区| 在线亚洲一区二区| 99国产精品国产精品久久| 国产成人aaa| 成人午夜看片网址| jlzzjlzz亚洲女人18| 成人午夜精品在线| 99r精品视频| 91电影在线观看| 欧美在线小视频| 欧美怡红院视频| 欧美综合在线视频| 精品视频色一区| 欧美福利一区二区| 精品卡一卡二卡三卡四在线| 精品国免费一区二区三区| 久久男人中文字幕资源站| 欧美精品一区二区三区视频| 337p粉嫩大胆噜噜噜噜噜91av| 久久这里只有精品6| 久久精品欧美一区二区三区麻豆| 日本一区二区三区在线观看| 国产精品每日更新在线播放网址| 国产精品日日摸夜夜摸av| 国产精品久久久久久亚洲伦| 亚洲啪啪综合av一区二区三区| 一区二区三区四区亚洲| 无吗不卡中文字幕| 狠狠色狠狠色综合| 成人av免费在线播放| 欧美色窝79yyyycom| 欧美一区二区三区电影| 久久夜色精品国产噜噜av| 国产精品系列在线| 亚洲动漫第一页| 国产综合久久久久久鬼色| 成人久久视频在线观看| 91麻豆免费看片| 日韩欧美一级二级| 国产精品蜜臀在线观看| 日韩精品一级二级| 国产91对白在线观看九色| 欧美在线观看视频一区二区| 日韩视频在线你懂得| 国产精品国产三级国产普通话蜜臀| 亚洲一二三区在线观看| 国产精品综合视频| 欧美日韩综合在线| 国产精品亲子乱子伦xxxx裸| 日日摸夜夜添夜夜添亚洲女人| 国产乱码精品一区二区三区忘忧草 | 国产精品久久久久久久久图文区| 亚洲一级电影视频| av一二三不卡影片| 精品国产亚洲在线| 午夜视频在线观看一区二区 | 成人动漫中文字幕| 日韩天堂在线观看|