本文整理汇总了C#中IInput类的典型用法代码示例。如果您正苦于以下问题:C# IInput类的具体用法?C# IInput怎么用?C# IInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IInput类属于命名空间,在下文中一共展示了IInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CPlayer
public CPlayer(IGameObjectManager pObjMan, IEngineCore pEngineCore)
: base(pObjMan, pEngineCore)
{
_fVelocity = 0f;
uiShotPause = 15;
ObjType = EGameObjectType.GotPlayer;
_stPos = new TPoint2(Res.GameVpWidth / 2f, Res.GameVpHeight / 2f);
_fSize = 150f;
_fColScale = 0.6f;
dimPl = new TPoint3(_fSize, _fSize, _fSize);
IResourceManager pResMan;
IEngineSubSystem pSubSys;
pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_INPUT, out pSubSys);
pInput = (IInput)pSubSys;
pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RESOURCE_MANAGER, out pSubSys);
pResMan = (IResourceManager)pSubSys;
IEngineBaseObject pBaseObj;
pResMan.GetResourceByName(Res.MeshShip, out pBaseObj);
pMesh = (IMesh)pBaseObj;
pResMan.GetResourceByName(Res.TexShip, out pBaseObj);
pTex = (ITexture)pBaseObj;
pResMan.GetResourceByName(Res.TexSpark, out pBaseObj);
pTexSpark = (ITexture)pBaseObj;
}
示例2: Console
public Console(IInput input, IViewer viewer)
{
Command = new Command();
_Filter = LogFilter.All;
_Initial(input , viewer);
}
示例3: TaskPresenter
public TaskPresenter(ITaskRepo taskRepo, IInput input, IPrompt prompt, IFileHistoryRepo fileHistoryRepo)
{
_taskRepo = taskRepo;
_input = input;
_prompt = prompt;
_fileHistoryRepo = fileHistoryRepo;
}
示例4: GrammerRuleHandler
public GrammerRuleHandler(IInput input)
{
this.input = input;
this.identifierMap = new Dictionary<string, object>();
ContextProvider.GetContext().SetContexts(identifierMap);
functionsIdentified = 0;
}
示例5: Console
public Console(IInput input, IViewer viewer)
{
Command = new Command();
_Filter = LogFilter.All;
_Commands = new Dictionary<string, string>();
_Initial(input, viewer);
}
示例6: Execute
/// <summary>
/// Executes the specified command for the specified connection.
/// </summary>
/// <param name="input">The IInput containing the command information to execute.</param>
/// <param name="connection">The IConnection executing the command.</param>
public void Execute(IInput input, IConnection connection)
{
// Find the command from the input.
var cmd = FindCommandInternal(input.CommandName);
if (cmd == null)
{
InvalidateResponse(input, connection, CommonResources.CommandInvalidFormat, input.CommandName);
return;
}
string errorMessage;
if (!cmd.Value.ValidateArguments(input, out errorMessage))
{
InvalidateResponse(input, connection, errorMessage);
return;
}
if (cmd.Value.RequiresUser && connection.User == null)
{
InvalidateResponse(input, connection, CommonResources.CommandRequiresUser);
return;
}
if (cmd.Value.RequiresCharacter && connection.Character == null)
{
InvalidateResponse(input, connection, CommonResources.CommandRequiresCharacter);
return;
}
var response = cmd.Value.Execute(input, connection);
connection.Write(response);
}
示例7: AGSSliderComponent
public AGSSliderComponent(IGameState state, IInput input, IGameEvents gameEvents)
{
_state = state;
_input = input;
_gameEvents = gameEvents;
OnValueChanged = new AGSEvent<SliderValueEventArgs> ();
}
示例8: Flush
private void Flush(IInput input)
{
if (input != null)
{
input.Flush();
}
}
示例9: AddInputChannel
// ------------ Input Channels ------------
public void AddInputChannel(IInput input)
{
if (InputChannels.Contains(input))
return;
InputChannels.Add(input);
}
示例10: AGSDraggableComponent
public AGSDraggableComponent(IInput input, IGameEvents gameEvents)
{
_input = input;
_gameEvents = gameEvents;
_gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
IsDragEnabled = true;
}
示例11: Algorithm
/// <summary>
/// Constructor (throws ArgumentException on invalid input)
/// </summary>
/// <param name="input">input object</param>
/// <param name="caseSensitive">flag whether find matches with case sensitive or not (default to case insensitive)</param>
public Algorithm(IInput input, IOverlapCalculator Table, bool caseSensitive = false)
{
try
{
if (input == null)
{
throw new ArgumentNullException(Errors.InputWasNull);
}
if (!input.IsValid)
{
throw new ArgumentException(Errors.InputWasInvalid);
}
if (Table == null)
{
throw new ArgumentNullException(Errors.OvelapCalculatorWasNull);
}
this.Text = input.Text;
this.SubText = input.SubText;
this.PrefixTable = Table.Compute();
this.IsCaseSensitive = caseSensitive;
}
catch (Exception e)
{
Logger.Push("Error received while initializing the KMPAlgorithm class object : " + e.Message);
throw;
}
}
示例12: Cpu
public Cpu(IMemory memory, IInput input, IOutput output)
{
_memory = memory;
In = input;
Out = output;
Registers = new byte[16];
Commands = new Dictionary<byte, Command>
{
{0x01, new IncCommand(this)},
{0x02, new DecCommand(this)},
{0x03, new MovCommand(this)},
{0x04, new MovcCommand(this)},
{0x05, new LslCommand(this)},
{0x06, new LsrCommand(this)},
{0x07, new JmpCommand(this)},
{0x0A, new JfeCommand(this)},
{0x0B, new RetCommand(this)},
{0x0C, new AddCommand(this)},
{0x0D, new SubCommand(this)},
{0x0E, new XorCommand(this)},
{0x0F, new OrCommand(this)},
{0x10, new InCommand(this)},
{0x11, new OutCommand(this)}
};
}
示例13: DebugStateUpdate
/// <summary>
/// DebugState update event
/// </summary>
/// <param name="input">Input</param>
/// <param name="deltaTime">Time since the last update</param>
private static void DebugStateUpdate(IInput input, float deltaTime)
{
if (input[Gamepad.Instance.Quit])
{
GameEngine.Instance.Quit();
}
}
示例14: CreateFakeInput
private static IInputObservable CreateFakeInput(IInput[] inputEvents)
{
var input = A.Fake<IInputObservable>();
var inputObs = Observable.Interval(TimeSpan.FromSeconds(0.1)).Take(inputEvents.Length).Select(i => inputEvents[i]); // spaces out the input by 1/10 of a second
A.CallTo(() => input.InputEvents).Returns(inputObs);
return input;
}
示例15: Update
public override void Update(GameTime gameTime, IInput input)
{
if (input != null)
{
if (input.IsKeyDown(Keys.Left) && direction != Direction.Right)
{
Direction = Direction.Left;
return;
}
if (input.IsKeyDown(Keys.Right) && direction != Direction.Left)
{
Direction = Direction.Right;
return;
}
if (input.IsKeyDown(Keys.Up) && direction != Direction.Bottom)
{
Direction = Direction.Top;
return;
}
if (input.IsKeyDown(Keys.Down) && direction != Direction.Top)
{
Direction = Direction.Bottom;
return;
}
}
}