⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startcommand.cs

📁 嵌入式程序
💻 CS
字号:
using System;

namespace DiamondPet.LogicLayer.GameStateStartLogic.StartCommand
{
	#region 向上命令
	/// <summary>
	/// UpCommand 的摘要说明。
	/// </summary>
	public class UpCommand : Command
	{
		private SelectState selectState;

		public UpCommand(SelectState s)
		{
			selectState = s;
		}

		public override void ExecuteCommand()
		{
			if(this.selectState.SelectIndex == 0)
			{
				this.selectState.SelectIndex = GameConstResource.btNumbers - 1;
			}
			else
			{
				this.selectState.SelectIndex = (this.selectState.SelectIndex - 1) % GameConstResource.btNumbers; 
			}
		}
	}

	#endregion

	#region 向左向右命令
	/// <summary>
	/// RightCommand 的摘要说明。
	/// </summary>
	public class RightCommand : Command
	{
		public RightCommand()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}

		public override void ExecuteCommand()
		{

		}
	}


	/// <summary>
	/// LeftCommand 的摘要说明。
	/// </summary>
	public class LeftCommand : Command
	{
		public LeftCommand()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}

		public override void ExecuteCommand()
		{

		}
	}
	#endregion

	#region 确定命令
	/// <summary>
	/// EnterCommand 的摘要说明。
	/// </summary>
	public class EnterCommand : Command
	{
		private SelectState selectState;

		public EnterCommand(SelectState s)
		{
			this.selectState = s;
		}

		public EnterCommand(UserLayerStateManager u) : base(u)
		{}

		public override void ExecuteCommand()
		{
			//进入选择模式  先设为一个人做测试

			this.selectState.userLayerStateManager.AnotherChangeState(this.selectState.SelectIndex);
		}
	}
	#endregion

	#region 向下命令
	/// <summary>
	/// DownCommand 的摘要说明。
	/// </summary>
	public class DownCommand : Command
	{
		private SelectState selectState;

		public DownCommand(SelectState s)
		{
			selectState = s;
		}

		public override void ExecuteCommand()
		{
			this.selectState.SelectIndex = (this.selectState.SelectIndex + 1) % GameConstResource.btNumbers; 
		}
	}
	#endregion
}

⌨️ 快捷键说明

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