嵌入式程序
源代码在线查看: staterunoneplayer.cs
using System;
namespace DiamondPet.UserLayer
{
///
/// StateRunOnePlayer 的摘要说明。
///
public class StateRunOnePlayer : GameStateRun
{
public StateRunOnePlayer()
{}
public StateRunOnePlayer(UserLayerStateManager u) : base(u)
{
this.runStateManager = new RunStateManager(u,this);
}
#region 主循环
public override void UserLayerRunning()
{
this.runStateManager.runningState.RunStateLogic();
}
#endregion
#region 按键控制
public override void UserLayerKeyDown(System.Windows.Forms.Keys key)
{
this.runStateManager.runningState.AddKeyCommand(key,true);
}
public override void UserLayerKeyUp(System.Windows.Forms.Keys key)
{
this.runStateManager.runningState.AddKeyCommand(key,false);
}
#endregion
}
}