class1.cs

来自「OOP With Microsoft VB.NET And Csharp Ste」· CS 代码 · 共 28 行

CS
28
字号
using System;

namespace MoveIt
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class Class1
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			IMoveable mover =new Pawn();
			mover.X =10;
			mover.Y =10;
			Console.WriteLine("X:{0} Y:{1}",mover.X, mover.Y);
			Console.WriteLine("Moving up 5 spaces.");
			mover.Move(Direction.Up, 5);
			Console.WriteLine("X:{0} Y:{1}",mover.X, mover.Y);
			Pawn pawn =(Pawn)mover;
			Console.WriteLine("Is the pawn captured? {0}",pawn.Captured);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?